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

#   Checkout message if particular product is selected

##

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

Less More

- Posts: 139
- Thank you received: 1
-
-

12 years 2 months ago [\#172029](#172029) by [abasel](/forum/user/6302-abasel "View abasel's Profile")  *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172029 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")* was created by *[abasel](/forum/user/6302-abasel "View abasel's Profile")*

-- HikaShop version -- : 2.3.2 (Business)
-- Joomla version -- : J3.3.3

Is it possible to add a message to the checkout but only if a certain product is purchased?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 2 months ago [\#172056](#172056) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172056 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")*

Hi,

Yes, you can edit the view "checkout / cart" for example, then add some php to check if the desired product is in the cart and display a message thanks to this kind of code: Code:

&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage('Your message here !'); ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 139
- Thank you received: 1
-
-

12 years 2 months ago [\#172168](#172168) by [abasel](/forum/user/6302-abasel "View abasel's Profile")  Replied by *[abasel](/forum/user/6302-abasel "View abasel's Profile")* on topic *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172168 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")*

Thanks for that but just one more question I will obviously have to have an if statement which says

if (product in basket) then do the code which you have give.

How do I test for the desired product it what does the condition part of the if statement look like?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 2 months ago [\#172227](#172227) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172227 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")*

Hello,
You'll just have use some code like : Code:

if($row-&gt;product_id == YOURPRODUCTID){ }

Just after this line : Code:

foreach($this-&gt;rows as $i =&gt; $row) {

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 139
- Thank you received: 1
-
-

12 years 2 months ago [\#172328](#172328) by [abasel](/forum/user/6302-abasel "View abasel's Profile")  Replied by *[abasel](/forum/user/6302-abasel "View abasel's Profile")* on topic *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172328 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")*

On further thought I need it to be for a product in a particular category.

Can I change product_id to category_id? And will it be in the same place

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 2 months ago [\#172340](#172340) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Checkout message if particular product is selected](/forum/27-checkout/871687-checkout-message-if-particular-product-is-selected#172340 "-- HikaShop version -- : 2.3.2 (Business) -- Joomla version -- : J3.3.3  Is it possible to add a message to the checkout but only if a certain product is purchased?")*

Hi,

If you want to base you check on the product category, you will have to perform a more complex algorithm.
A product can be in several categories, so we do not load all the categories every time (just when it is really needed).
You can have the category list under "$row-&gt;categories" but if not, you have to load them yourself.

It requires some development and PHP skills.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTY4Ny1jaGVja291dC1tZXNzYWdlLWlmLXBhcnRpY3VsYXItcHJvZHVjdC1pcy1zZWxlY3RlZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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.069 seconds

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