classes/XLite/Module/XCExample/ProductDiscount/Main.php 0000666 00000002154 13240372511 0017033 0 ustar 00 isMyDiscount()) {
$this->setPriceBeforeMyProductDiscount($price);
$price = 0.9 * $price;
}
return $price;
}
protected function setPriceBeforeMyProductDiscount($price)
{
$this->priceBeforeMyProductDiscount = $price;
}
public function getPriceBeforeMyProductDiscount()
{
return $this->priceBeforeMyProductDiscount;
}
public function isMyDiscount()
{
return 0 === stripos($this->getName(), 'A');
}
} classes/XLite/Module/XCExample/ProductDiscount/View/AView.php 0000666 00000001127 13240372511 0020073 0 ustar 00 getProduct();
if ($product->isMyDiscount()) {
$labels += array('my-discount' => static::t('10% off'));
}
return $labels;
}
} classes/XLite/Module/XCExample/ProductDiscount/View/Price.php 0000666 00000001126 13240372511 0020121 0 ustar 00 getProduct()->getPriceBeforeMyProductDiscount();
}
protected function isMyDiscount()
{
return $this->getProduct()->isMyDiscount();
}
} skins/customer/modules/XCExample/ProductDiscount/old-price.twig 0000666 00000000401 13240372511 0020732 0 ustar 00 {##
# @ListChild (list="product.plain_price", weight="100")
#}
{% if this.isMyDiscount() %}
Old price: {{ this.formatPrice(this.getPriceBeforeMyDiscount(), this.null, 1)|raw }}
{% endif %} skins/customer/modules/XCExample/ProductDiscount/css/style.css 0000666 00000000563 13240372511 0020633 0 ustar 00 /* vim: set ts=2 sw=2 sts=2 et: */
/**
* CSS classes
*
* Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
* See https://www.x-cart.com/license-agreement.html for license details.
*/
ul.product-price li.old-price {
display: block;
font-size: 18px;
}
ul.product-price li.old-price span.old-price {
text-decoration: line-through;
} .phar/.metadata.bin 0000000 00000000641 00000000000 0010030 0 ustar 00 a:12:{s:12:"RevisionDate";i:1518466377;s:10:"ActualName";s:25:"XCExample\ProductDiscount";s:12:"VersionMajor";s:3:"5.3";s:12:"VersionMinor";s:1:"0";s:12:"VersionBuild";s:1:"0";s:14:"MinCoreVersion";s:1:"0";s:4:"Name";s:33:"Example "Product discount" module";s:6:"Author";s:15:"X-Cart examples";s:8:"IconLink";N;s:11:"Description";s:33:"Example "Product discount" module";s:12:"Dependencies";a:0:{}s:8:"isSystem";b:0;} .hash 0000666 00000001352 13240372511 0005473 0 ustar 00 {"classes\/XLite\/Module\/XCExample\/ProductDiscount\/Main.php":"0af99fe4ea002d6dea078a90930d8320","classes\/XLite\/Module\/XCExample\/ProductDiscount\/Model\/Product.php":"46b5ab58e12edf3ad3a0a75c0e622a3d","classes\/XLite\/Module\/XCExample\/ProductDiscount\/View\/AView.php":"ced8b71f95987fabbeac6ced1fe1fe60","classes\/XLite\/Module\/XCExample\/ProductDiscount\/View\/Product\/ListItem.php":"2d540a0967f65a7124995e3f8857c135","classes\/XLite\/Module\/XCExample\/ProductDiscount\/View\/Price.php":"33df35b4930bb9959360c7d830cd717d","skins\/customer\/modules\/XCExample\/ProductDiscount\/old-price.twig":"79605f4477a2d053f2198a3c0582d617","skins\/customer\/modules\/XCExample\/ProductDiscount\/css\/style.css":"0c077d3fa64e4b59612997e3ee5cfa8f"}