Hello @
Kackavaljer,
Here is how you can try to achieve it.
1) You need to decorate JS' ProductsListView.prototype.postprocess method described in the <X-Cart>/skins/default/en/items_list/product/products_list.js file, so it would work with
add2_cart_popup target instead of
quick_look.
Example of decorating JS scripts is in the <X-Cart>/skins/default/en/modules/XC/ProductComparison/compare/products/script.js file that decorates the same method.
2) Then, we need to apply changes to \XLite\Module\XC\Add2CartPopup\View\Add2Cart widget.
The condition
PHP Code:
if ($this->getParam(static::PARAM_DISPLAY_CACHED)) {
should be replaced with this one:
PHP Code:
if ($this->getParam(static::PARAM_DISPLAY_CACHED) && !\XLite\Core\Request::getInstance()->product_id) {
and the getProduct() method should be defined as follows:
PHP Code:
protected function getProduct()
{
if (\XLite\Core\Request::getInstance()->product_id) {
$product = \XLite\Core\Database::getRepo('XLite\Model\Product')->find(\XLite\Core\Request::getInstance()->product_id);
}
if (!$product && $this->getItem()) {
$product = $this->getItem()->getProduct();
}
return $product;
}
Please, let me know if it helps.
Tony