News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

changing the cart message depending on the products category

Started by lostpanther, November 08, 2013, 12:43:04 PM

Previous topic - Next topic

lostpanther

I am trying to change the title of the message that is displayed above the comment form,
a different message for each product category.
i have tested if and else statements and have got it working using this
inside
com_virtuemart/views/cart/tmpl/default.php

<?php $category = "Gift Shop";
if ( $category == "Gift Shop" ) {
   echo JText::_ ('COM_VIRTUEMART_COMMENT_CART');
}
else {
   echo "<h1>FLOWER MESSAGE</h1></br>
<p>Please leave a message to be added to this arrangement</p>";
}
?>

the full code is below

<?php // Leave A Comment Field ?>
   <div class="customer-comment marginbottom15">
         <span class="comment"><?php $category = "Gift Shop";
if ( $category == "Gift Shop" ) {
   echo JText::_ ('COM_VIRTUEMART_COMMENT_CART');
}
else {
   echo "<h1>FLOWER MESSAGE</h1></br>
<p>Please leave a message to be added to this arrangement</p>";
}
?></span><br/>

I haven't figured out how to replace the "Gift Shop" with the actual product category, is there a way of getting the code to check the product category of the item displayed and then add the category id to the statement ?
i am sorry but i am a noob
any help will be appreciated
thanks matt