Jump to content

How to create a new macro?


Guest danthewireman

Recommended Posts

Guest danthewireman

This is my first time using CC, so apologies if I'm asking dumb/ignorant questions.

Here are the rules I'm trying to put into place:

- coupon discounts do not apply to sale items

- when only sale items are in the cart, there's no place to enter a coupon

I'd like to take baby steps, so first, I tried to do is have some flag on the View Cart page that knew if a product was on sale or not. I added this line to includes/boxes/shoppingCart.inc.php:

$box_content->assign("PRODUCT_IS_SALE_ITEM", "test" );




And this in skins/mytemplate/styleTemplates/content/cart.tpl:




<td class="{TD_CART_CLASS}" align="right" nowrap="nowrap">{VAL_LINE_PRICE}<span style="color:#000">{PRODUCT_IS_SALE_ITEM}..</span></td>




The resulting HTML is 




<span style="color:#000">..</span>

I'm mystified as to why the value of the macro didn't come through. I've searched Google and these forums, and I haven't found the answer. I suspect I'm missing something really simple.

Any ideas?

Thanks for any help.

Link to comment
Share on other sites

Hi Dan,

I think you're nearly there - good work so far.

There is a documentation project for the template engine, and this explains things better than can be covered here (this forum is not really for changes to the code).

You'll find this information on the site in my signature (cubecartforums.org)

If you do have questions, I'd suggest asking over in the other forum, lots of people who can help - and also lots of resources.

Jason

Link to comment
Share on other sites

Guest danthewireman

Hi Dan,

I think you're nearly there - good work so far.

There is a documentation project for the template engine, and this explains things better than can be covered here (this forum is not really for changes to the code).

You'll find this information on the site in my signature (cubecartforums.org)

If you do have questions, I'd suggest asking over in the other forum, lots of people who can help - and also lots of resources.

Jason

Thanks! Reposted

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...