Created
October 18, 2017 22:36
-
-
Save flocondetoile/54c7eccf7776759262e548310dd22947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$build['quickview'] = [ | |
'#type' => 'link', | |
'#url' => Url::fromRoute('mymodule.product_quickview', ['commerce_product' => $entity->id()]), | |
'#title' => $this->t('Quick view'), | |
'#attributes' => [ | |
'class' => ['use-ajax', 'button', 'button--small', 'button--check-stock'], | |
'data-dialog-type' => 'modal', | |
'data-dialog-options' => Json::encode([ | |
'dialogClass' => 'ui-dialog--wide ui-dialog--centered-title ui-dialog--product-stock-levels', | |
'width' => 1000, | |
]), | |
], | |
]; | |
mymodule.product_quickview: | |
path: '/product/quick-view/{commerce_product} | |
defaults: | |
_entity_view: commerce_product.quickview | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment