- Posts: 139
- Thank you received: 1
Checkout message if particular product is selected
12 years 3 weeks ago #172029
by abasel
Checkout message if particular product is selected was created 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?
-- 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 weeks ago #172056
by Xavier
Replied by Xavier on topic Checkout message if particular product is selected
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:
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 weeks ago #172168
by abasel
Replied by abasel on topic Checkout message if particular product is selected
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?
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 2 weeks ago #172227
by Mohamed Thelji
Replied by Mohamed Thelji on topic Checkout message if particular product is selected
Hello,
You'll just have use some code like :
Just after this line :
You'll just have use some code like :
Code:
if($row->product_id == YOURPRODUCTID){
}
Code:
foreach($this->rows as $i => $row) {
Please Log in or Create an account to join the conversation.
12 years 2 weeks ago #172328
by abasel
Replied by abasel on topic Checkout message if particular product is selected
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
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 weeks ago #172340
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Checkout message if particular product is selected
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,
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.206 seconds