whodah Posted August 19, 2015 Share Posted August 19, 2015 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 More sharing options...
Jack_mcs Posted August 19, 2015 Share Posted August 19, 2015 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 More sharing options...
whodah Posted August 20, 2015 Author Share Posted August 20, 2015 Hello, Okey dokey, gotcha. I thought there might be a hook, or something, that could be used rather than modifying core code. Thanks! Link to comment Share on other sites More sharing options...
ArtcoInc Posted August 20, 2015 Share Posted August 20, 2015 @@whodah Are you looking to do the replacement 'on the fly', or a mass replacement in the database itself? Malcolm Link to comment Share on other sites More sharing options...
whodah Posted August 21, 2015 Author Share Posted August 21, 2015 Hello, In this case, on the fly as the final replacement(s) will be dynamic. Thanks, -Jeremy Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted August 21, 2015 Share Posted August 21, 2015 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 More sharing options...
whodah Posted August 24, 2015 Author Share Posted August 24, 2015 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.