Jump to content

Reduced Price


geoffb

Recommended Posts

Hi,

 

Just looking for a simple way of including some sort of 'REDUCED' image ribbon to the top left of the latest_product div class when the price div has an included span class of previous_price, so for instance:

 

some form of jQuery that says: if the div .price includes a span element of .previous_price append a new div of .ribbon to div of .latest_product

 

any help much appreciated.

 

Geoff

Link to comment
Share on other sites

Hi anyone,

 

Sorted this one as there is a {$if} {$else} statement on the template so I have just included a ribbon div and will positions it using absolute against the latest_product div, i do though have another question!

 

I am trying to produce the following layout on the lastest products element of the homepage:

 

Product image

Brand

Product Name

Price

Details and Add to basket buttons

 

I have all sorted apart from echo'ing out the Brand name, i have tried:

 

{$MANUFACTURER} ...produces no output

{$product.manufacturer} ...produces a number, most likely the number recorded against the manufacturer database entry

{$product.brand} ...produces no output

 

thanks

Geoff

Link to comment
Share on other sites

No output? At all? Or just no change from what was before?

 

If just no change, we need to tell the template engine to discard the current cached template and render a new one.

 

In admin, Maintenance, Rebuild tab, check Clear Cache, Submit.

 

Post#6 in that other conversation was dealing with the View category page. Post#9 (for classes/cubecart.class.php) talks about the Latest Products (Homepage) page.

Link to comment
Share on other sites

Thanks bsmither, all done!

 

Just 2 questions, how will this be affected if and when I update for future versions, will I need to alter these files again as they they will be over written with the new one?

 

lastly, I would like to show the product star ratings on the homepage latest products for any products that have them, is there an easy way to do this, I have as usual tried using the code from the products template but it must need something else.

 

Geoff

Link to comment
Share on other sites

"how will this be affected if and when I update for future versions, will I need to alter these files again as they they will be over written with the new one?"

 

Correct. CubeCart's current paradigm of upgrading is to replace the entire stock package. The way around this is to use plugin/snippet technology. But plugins and snippets do not work with the CubeCart Lite, and I wasn't sure if the necessary hooks were at our disposal.

 

"lastly, I would like to show the product star ratings on the homepage latest products for any products that have them, is there an easy way to do this"

 

Yes. But please start a new conversation with the appropriate tags.

Link to comment
Share on other sites

Mostly yes, sometimes no.

 

For every release of CC5, there seems to be available more controller hooks that developers can use. But they are not everywhere.

 

As for the views, detecting and modifying skin code is a losing game. The XPATH to any node that needs tweaking is not guaranteed to be consistent across any skin. On the other hand, you are encouraged to make a copy of a stock skin if you want to change it -- not change an existing skin.

Link to comment
Share on other sites

Mostly yes, sometimes no.

 

For every release of CC5, there seems to be available more controller hooks that developers can use. But they are not everywhere.

As far as additional functionality is concerned (as opposed to bug fixes that require code changes) there should generally NEVER be a requirement to change core code. While Brian is correct that hooks are not always readily available in the correct places, Al and the team have said from day one that they will add any new hook requested into the next core version release (see at the bottom of the following article from April 2012 (!!) - https://support.cubecart.com/index.php?/Knowledgebase/Article/View/203/46/how-can-i-create-a-plugin-using-the-code-hooks-system-in-cubecart-v5).

We have written quite a few plugins for V5 and most required one or more new hooks to be added - the plugin was written and the hook request made and these have always been added by the team meaning the customers using those plugins can upgrade simply and easily.

Writing a plugin does take more effort and time than hacking the code but in the long term it is far preferable to do it this way

Thanks

Ian

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...