- Posts: 35
- Thank you received: 1
coupon discount value in product page
- simone.ceschi
-
Topic Author
- Offline
Less
More
8 years 11 months ago #283473
by simone.ceschi
coupon discount value in product page was created by simone.ceschi
hi , in cart page , i saw the code :
$this->element->coupon->discount_value
i tried to use on show_default.php page but it's not definited.
i wanna put a message on product page like " - 5 % at checkout" or " - 10€ at checkout" , but i need to load coupon value for this product.
i must use only COUPON, not discount
it's possible ?
$this->element->coupon->discount_value
i tried to use on show_default.php page but it's not definited.
i wanna put a message on product page like " - 5 % at checkout" or " - 10€ at checkout" , but i need to load coupon value for this product.
i must use only COUPON, not discount
it's possible ?
Please Log in or Create an account to join the conversation.
8 years 11 months ago #283489
by nicolas
Replied by nicolas on topic coupon discount value in product page
Hi,
The coupon variable in $this->element on the cart page is there because $this->element is the cart object there.
The coupons apply to carts, not products. So it's not possible to have such data on the product page as the coupon is not yet loaded hen you reach the product page.
The coupon is loaded by the cart system when the cart data is loaded.
Now you could always have custom MySQL queries on the product page to load the coupons having restrictions on products/categories and display their value. A developer shouldn't have a problem doing that.
The coupon variable in $this->element on the cart page is there because $this->element is the cart object there.
The coupons apply to carts, not products. So it's not possible to have such data on the product page as the coupon is not yet loaded hen you reach the product page.
The coupon is loaded by the cart system when the cart data is loaded.
Now you could always have custom MySQL queries on the product page to load the coupons having restrictions on products/categories and display their value. A developer shouldn't have a problem doing that.
Please Log in or Create an account to join the conversation.
- simone.ceschi
-
Topic Author
- Offline
Less
More
- Posts: 35
- Thank you received: 1
8 years 11 months ago #283552
by simone.ceschi
Replied by simone.ceschi on topic coupon discount value in product page
ok ,
and what page is the function that makes the autoload of the coupon?
because surely on that page will make a check on the product added to the cart before loading the coupon.
and what page is the function that makes the autoload of the coupon?
because surely on that page will make a check on the product added to the cart before loading the coupon.
Please Log in or Create an account to join the conversation.
8 years 11 months ago #283568
by nicolas
Replied by nicolas on topic coupon discount value in product page
Hi,
There is such thing yes. It's done in the function "getFullCart" of the file administrator/components/com_hikashop/classes/cart.php
There, when the cart is being loaded, the coupon in the cart is loaded together (if it's still valid), and if there isn't one in the cart, the system tries to load the "auto loaded" coupons you've configured.
There is such thing yes. It's done in the function "getFullCart" of the file administrator/components/com_hikashop/classes/cart.php
There, when the cart is being loaded, the coupon in the cart is loaded together (if it's still valid), and if there isn't one in the cart, the system tries to load the "auto loaded" coupons you've configured.
Please Log in or Create an account to join the conversation.
Time to create page: 0.055 seconds