Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Products Index Module Rich Snippets #386

Closed
frankludriks opened this issue May 27, 2016 · 3 comments
Closed

New Products Index Module Rich Snippets #386

frankludriks opened this issue May 27, 2016 · 3 comments

Comments

@frankludriks
Copy link

Error when validating page when module is enabled on index page.

includes/modules/content/index/cm_i_new_products.php line 36 needs to be changed from

global $oscTemplate, $new_products_category_id, $languages_id, $currencies, $PHP_SELF;

to

global $oscTemplate, $new_products_category_id, $languages_id, $currencies, $PHP_SELF, $currency;

includes/modules/content/index/templates/new_products.php

line 28 needs to be changed from

<p class="text-center" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="price"><?php echo $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); ?></span></p>

to

<p class="text-center" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="price" content="<?php echo preg_replace('/[^0-9.]*/', '', $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id']))); ?>"><meta itemprop="priceCurrency" content="<?php echo tep_output_string($currency); ?>" /><?php echo $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); ?></span></p>

Code tested and working, validates correctly at https://search.google.com/structured-data/testing-tool

@gburton
Copy link
Owner

gburton commented Jun 1, 2016

Thanks @frankludriks

<p class="text-center" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="price" content="<?php echo preg_replace('/[^0-9.]*/', '', $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']))); ?>"><meta itemprop="priceCurrency" content="<?php echo tep_output_string($currency); ?>" /><?php echo $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); ?></span></p>

Is I think where it should be ? Would want doing in both new_product modules (cm_i_* and cm_in_*

Thoughts ?

@frankludriks
Copy link
Author

Much better using correct $ values!

Can't test until next week, but yes, should be in both.

@gburton
Copy link
Owner

gburton commented Jun 2, 2016

No problem. I have optimised the whole thing to use a new function from the currencies class... $currencies->display_raw() - this deals with wacky setups like shopowners who sell in Euros, where the decimal point is a comma.

https://github.com/gburton/Responsive-osCommerce/pull/387/files

@gburton gburton closed this as completed Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants