Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

item description text replacement - best practices?


Recommended Posts

Hello,

 

I'd like to insert some PHP code to replace terms/words in an item description automatically. I kludged this in 2.2, but was wondering where the best place and/or approach (least obtrusive) would be for BS 2.3.4?

 

I.e. if a product description is:

 

The best __DVD__ around.

 

I'll replace "__DVD__" with " DVD or Blu-ray " making the customer displayed description: 

 

The best DVD or Blu-ray around.

 

My replacements are a bit more complex than this example, but you get the idea. :)

 

Thanks! 

 

Link to comment
Share on other sites

If you are talking about doing this on the fly on the shops product page, find this line

echo stripslashes($product_info['products_description']);

And change it something like

echo stripslashes(str_replace('DVD', 'DVD or Blur Ray',$product_info['products_description']));

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I've used phpgiggle in the past.

 

http://sourceforge.net/projects/phpgiggle/files/

 

not 100% what you need, but i think it is getting close

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hi all,

 

Thanks for the replies. Jack_mcs's solution (or at least thought process as I haven't coded it yet) works fine, and is indeed near the kludge I used in 2.2. I was thinking/hoping there was some sort of hook/plugin that I could use on the newer version of OSC vs. modifying core code.

 

Thanks for the help, all!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...