Source of file LivePubProduct.php
Size: 0,725 Bytes - Last Modified: 2021-12-23T10:03:27+00:00
/var/www/docs.ssmods.com/process/src/code/LivePubProduct.php
123456789101112131415161718192021222324252627 | <?php /** * Extensions to Product class to help with static caching via livepub * * @author Mark Guinn <mark@adaircreative.com> * @date 06.04.2014 * @package shop_livepub */ class LivePubProduct extends DataExtension { /** * Livepub compatible: 'in-cart' or 'not-in-cart' based on session cart * TODO: this won't cover the case where a variation of this product is in the cart. * @return string */ public function CartStateClass() { return LivePubHelper::eval_php(' return (!empty($_SESSION["Cart"]) && !empty($_SESSION["Cart"]["Items"]) && !empty($_SESSION["Cart"]["Items"][' . $this->owner->ID . '])) ? "product-in-cart" : "product-not-in-cart"; '); } } |