Jump to content

Hide price for products without price in RSS feed blockrss module


D D

Recommended Posts

Hi all,

I’m trying to find a way to hide the price for products in my RSS feed that don’t have price. Currently, my PrestaShop 1.6.0.9 site displays a price of 0,00 for such products even if I already unchecked the options such as “Available for order”, “Show price”. Such products do appear without price on the site, but not in the RSS feed. It’s the same even if I change the product type to “Virtual product” for example.

So, in the case of displaying products in an RSS feed, for some reason PrestaShop thinks that a product should always have price despite the fact that the product is actually without a price.

Any suggestions welcome!

Edited by D D (see edit history)
Link to comment
Share on other sites

2 hours ago, D D said:

Hi all,

I’m trying to find a way to hide the price for products in my RSS feed that don’t have price. Currently, my PrestaShop 1.6.0.9 site displays a price of 0,00 for such products even if I already unchecked the options such as “Available for order”, “Show price”. Such products do appear without price on the site, but not in the RSS feed. It’s the same even if I change the product type to “Virtual product” for example.

So, in the case of displaying products in an RSS feed, for some reason PrestaShop thinks that a product should always have price despite the fact that the product is actually without a price.

Any suggestions welcome!

 

Check this module https://addons.prestashop.com/en/order-management/26993-hide-price-and-disallow-purchase-of-products.html

Link to comment
Share on other sites

Hi again,

Currently, my RSS feed looks more or less like this:

 

 

There's a price attached in the end of every product title. That's fine for the products with actual prices, but the problem is that the price of 0,00 appears when there are products without prices in the RSS feed.

Does anybody know what exactly should I change and where, so that the price doesn't appear in the RSS feed (especially for products without price)?

Thank you.

Edited by D D (see edit history)
Link to comment
Share on other sites

Hi all,

Oddly, the RSS module that I use is installed in a folder that doesn’t correspond to the module's name and most probably that caused my confusion. Anyway, as displaying prices in the titles of my RSS feed is not needed, commenting out the code for the price in the product title did the job.

So, I opened the original rss.php file in public_html/modules/feeder and commented out the line that contains the code for displaying the price:

echo "\t\t\t<title><![CDATA[".$product['name']."<!-- - ".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')." ]]>--></title>\n";

Now, there are no more prices attached to the product titles of my RSS feed. I’m very pleased with this solution.

P.S. Still not sure about how to only hide the price for products that actually don’t have a price though.

Edited by D D (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...