Skip to main content

Checkout message if particular product is selected

12 years 2 months ago #172029 by abasel
-- 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 or Create an account to join the conversation.

12 years 2 months ago #172056 by Xavier
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:
<?php $app = JFactory::getApplication(); $app->enqueueMessage('Your message here !'); ?>

Please Log in or Create an account to join the conversation.

12 years 2 months ago #172168 by abasel
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 or Create an account to join the conversation.

12 years 2 months ago #172227 by Mohamed Thelji
Hello,
You'll just have use some code like :
Code:
if($row->product_id == YOURPRODUCTID){ }
Just after this line :
Code:
foreach($this->rows as $i => $row) {

Please Log in or Create an account to join the conversation.

12 years 2 months ago #172328 by abasel
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 or Create an account to join the conversation.

12 years 2 months ago #172340 by Jerome
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->categories" but if not, you have to load them yourself.

It requires some development and PHP skills.

Regards,

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.051 seconds
Powered by Kunena Forum