[Skip to main content](#vessel-content)

#   coupon discount value in product page

##

- **[simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")**
- [![simone.ceschi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile") Topic Author
- [ Offline](/forum/user/14049-simone-ceschi)

Less More

- Posts: 35
- Thank you received: 1
-
-

8 years 11 months ago [\#283473](#283473) by [simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")  *[coupon discount value in product page](/forum/26-product-category-display/892974-coupon-discount-value-in-product-page#283473 "hi , in cart page , i saw the code :  $this-&gt;element-&gt;coupon-&gt;discount&#95;value  i tried to use on show&#95;default.php page but it's not definited.  i wanna put a message on product page like &quot; - 5 % at checkout&quot; or &quot; - 10€ at checkout&quot; , but i need to load coupon value for this product. i must use only COUPON, not discount it's possible ?")* was created by *[simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")*

hi , in cart page , i saw the code :

**$this-&gt;element-&gt;coupon-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI5NzQtY291cG9uLWRpc2NvdW50LXZhbHVlLWluLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 11 months ago [\#283489](#283489) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[coupon discount value in product page](/forum/26-product-category-display/892974-coupon-discount-value-in-product-page#283489 "hi , in cart page , i saw the code :  $this-&gt;element-&gt;coupon-&gt;discount&#95;value  i tried to use on show&#95;default.php page but it's not definited.  i wanna put a message on product page like &quot; - 5 % at checkout&quot; or &quot; - 10€ at checkout&quot; , but i need to load coupon value for this product. i must use only COUPON, not discount it's possible ?")*

Hi,

The coupon variable in $this-&gt;element on the cart page is there because $this-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI5NzQtY291cG9uLWRpc2NvdW50LXZhbHVlLWluLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")**
- [![simone.ceschi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile") Topic Author
- [ Offline](/forum/user/14049-simone-ceschi)

Less More

- Posts: 35
- Thank you received: 1
-
-

8 years 11 months ago [\#283552](#283552) by [simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")  Replied by *[simone.ceschi](/forum/user/14049-simone-ceschi "View simone.ceschi's Profile")* on topic *[coupon discount value in product page](/forum/26-product-category-display/892974-coupon-discount-value-in-product-page#283552 "hi , in cart page , i saw the code :  $this-&gt;element-&gt;coupon-&gt;discount&#95;value  i tried to use on show&#95;default.php page but it's not definited.  i wanna put a message on product page like &quot; - 5 % at checkout&quot; or &quot; - 10€ at checkout&quot; , but i need to load coupon value for this product. i must use only COUPON, not discount it's possible ?")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI5NzQtY291cG9uLWRpc2NvdW50LXZhbHVlLWluLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 11 months ago [\#283568](#283568) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[coupon discount value in product page](/forum/26-product-category-display/892974-coupon-discount-value-in-product-page#283568 "hi , in cart page , i saw the code :  $this-&gt;element-&gt;coupon-&gt;discount&#95;value  i tried to use on show&#95;default.php page but it's not definited.  i wanna put a message on product page like &quot; - 5 % at checkout&quot; or &quot; - 10€ at checkout&quot; , but i need to load coupon value for this product. i must use only COUPON, not discount it's possible ?")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTI5NzQtY291cG9uLWRpc2NvdW50LXZhbHVlLWluLXByb2R1Y3QtcGFnZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.064 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
