Guest Posted November 15, 2018 Share Posted November 15, 2018 I use osCommerce 2.3.4.1 CE Boot strap version I need to show a player on the list view version of the productlisting like this In proct info I insert the code <AUDIO controls><SOURCE type="audio/mpeg" src="https://www.something.se/some/song1.mp3"></AUDIO> But there is the strip_tags code, how can I change this so the mp3 player shows in product listing, I guess the code in the file is $prod_list_contents .= ' <p class="group inner list-group-item-text" itemprop="description">' . strip_tags($listing['products_description'], '<br>') . '…</p><div class="clearfix"></div>'; Link to comment Share on other sites More sharing options...
♥raiwa Posted November 15, 2018 Share Posted November 15, 2018 try: $prod_list_contents .= ' <p class="group inner list-group-item-text" itemprop="description">' . $listing['products_description'] . '…</p><div class="clearfix"></div>'; But be aware that the description is also shortened to 20 words in the products queries: $listing_sql = "select p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description,....... Depending on your Store version you'll find the queries in index.php or if modularized in the content module: includes/mnodules/content/index_products/cm_ip_product_listing.php If you need the complete description change the above in all queries to: $listing_sql = "select p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, p.products_id, pd.products_description,....... About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
MrPhil Posted November 15, 2018 Share Posted November 15, 2018 The code in question is intended to offer a short "teaser" from the full product description. This involves taking only a few (20) words and stripping out all HTML tags. If you don't want to lose the audio player, but want to keep the "teaser" functionality for other products, you might be able to add code to check if the audio player is being requested (preg_match call looking for the audio tag), and if it is, don't strip tags. You might have to get the full product description for all products, and only for non-audio player do you trim it down after stripping tags. strip_tags() has a list of tags to exclude, so you might be able to use that (but without other changes, it might have already been cut down too much). For any product, you might want to keep simple in-line tags like <i> and <b> (as well as the audio player tags)... it's really the major block stuff you want to kill. Anyway, there are a bunch of issues to be aware of, and a number of approaches you could take. Link to comment Share on other sites More sharing options...
♥raiwa Posted November 15, 2018 Share Posted November 15, 2018 Another, cleaner aproach would be to add the player code to the product listing and use an additional field to hold the audio filename. You would need to add the field to the product table in the database and coding to enter the filename in admin/categories.php About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2018 Share Posted November 15, 2018 1 hour ago, raiwa said: $prod_list_contents .= ' <p class="group inner list-group-item-text" itemprop="description">' . $listing['products_description'] . '…</p><div class="clearfix"></div>'; Thank you! That worked. It is only the player in every product so the short 20 word is ok. Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2018 Share Posted November 15, 2018 1 hour ago, MrPhil said: The code in question is intended to offer a short "teaser" from the full product description. This involves taking only a few (20) words and stripping out all HTML tags. If you don't want to lose the audio player, but want to keep the "teaser" functionality for other products, you might be able to add code to check if the audio player is being requested (preg_match call looking for the audio tag), and if it is, don't strip tags. You might have to get the full product description for all products, and only for non-audio player do you trim it down after stripping tags. strip_tags() has a list of tags to exclude, so you might be able to use that (but without other changes, it might have already been cut down too much). For any product, you might want to keep simple in-line tags like <i> and <b> (as well as the audio player tags)... it's really the major block stuff you want to kill. Anyway, there are a bunch of issues to be aware of, and a number of approaches you could take. There is no other products than the songs and only the player in description so it s no problem. Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2018 Share Posted November 15, 2018 I need the bestseller menu box to show the player too, is there a module that shows product description there ? Link to comment Share on other sites More sharing options...
♥raiwa Posted November 15, 2018 Share Posted November 15, 2018 add the code to retrieve the description and to show it to the bestseller box. You have the example in index/product listing and in product_info.php About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.