What's New
Viewing 12 posts - 1 through 12 (of 12 total)
Viewing 12 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic.
Hello. I have a group of customers with discounts. If a client from such a group is authorized, he sees prices with discount. But there is no mark that the discount is applied. How can I do in categories and in the product’s card price display on the example of a simple discount.
How now: 1.jpg
How it should be displayed: 2.jpg
And how can I show the size of the discount at the top, where the name of the client is written? For example: Bill Gates (5% discount)
Prestashop 1.6.1.22
PHP 7.0.31
Hi,
Please modify the \modules\blockuserinfo_mod\blockuserinfo_mod.php file, add the following code:
$discount = '';
if ($id_product = Tools::getValue('id_product')) {
$id_group = null;
if ($id_customer) {
$id_group = Customer::getDefaultGroupId((int)$id_customer);
}
if (!$id_group) {
$id_group = (int)Group::getCurrent()->id;
}
$reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group);
if ($reduction_from_category !== false) {
$discount = $reduction_from_category*100;
} else { // apply group reduction if there is no group reduction for this category
$discount = Group::getReductionByIdGroup($id_group) != 0 ? ($reduc / 100) : '';
}
$this->smarty->assign(array(
'gpr_discount' => $discount,
));
}
And modify the \modules\blockuserinfo_mod\views\templates\hook\nav.tpl file, add the following code:
{if isset($gpr_discount) && $gpr_discount}({$gpr_discount}%{l s='discount' mod='blockuserinfo_mod'}){/if}
See attached screenshots.
Best regards.
hi @yobo , This is not longer valid as it seems this module does not exist any more. Could you update the info?
I found this topic but I can not make it work since I am not sure either where to put the codes:
https://www.prestashop.com/forums/topic/570297-show-original-product-price-to-customer-group-with-discount/
EDIT: solved with the option: Catalog-> Discounts -> Catalog Price Rules.
You must be logged in to reply to this topic.