You are here:  » Bug displaying products with full-stop in title


Bug displaying products with full-stop in title

Submitted by jamie on Sun, 2017-01-08 11:26 in

Hi David,

There appears to be a bug when view products with a full-stop in the title name.

For instance, in the WP installation, when viewing a product such as...

http://www.example.com/product/sony-tv-9.0-television.html

... nothing is displayed. However, when viewing on the PT installation at...

http://www.example.com/pt/product/sony-tv-9.0-television.html

... the product is displayed correctly.

Also, when doing a search on the WP installation, products are correctly listed. And related products with full-stop are displayed correctly. However its all the parts under "Product" in the PT settings that are not displayed correctly. So the image, title and description.

Any ideas how to fix this please?

Thanks
Jamie

Submitted by support on Mon, 2017-01-09 10:43

Hello Jamie,

Thanks for pointing this out, the full-stop is not added as a permitted character in the product name as it is in the standalone distribution. I will correct this in the next update, in the meantime, to apply the fix edit the plugin file pto.php and look for the following code at line 165:

  $pto_product = (isset($pto_product)?pto_common_normalise(urldecode($pto_product)):"");

...and REPLACE with:

  $pto_product = (isset($pto_product)?pto_common_normalise(urldecode($pto_product),"\."):"");

Cheers,
David.
--
PriceTapestry.com

Submitted by j.whittlesea@bt... on Thu, 2018-02-08 13:44

I now have a problem with ? and copyright character in the url not displaying product page information. They show in retailer list but not when selected.

Examples {link saved} from {link saved}

Cannot find fix for this.

Regards

Jeff

Submitted by support on Thu, 2018-02-08 14:37

Hello Jeff,

I think this will be down to a character set / collation mis-match between the WordPress installation and the associated Price Tapestry installation. Please could you check your WordPress configuration file wp-config.php around line 35 and if you see DB_CHARSET defined as 'utf8mb4' as follows;

define('DB_CHARSET', 'utf8mb4');

(instead of 'utf8') then the Price Tapestry installation / tables can be changed to match. To do this, first edit includes/database.php of the associated Price Tapestry installation and look for the following code at line 18:

      mysqli_set_charset($database_link,"utf8");

...and REPLACE with:

      mysqli_set_charset($database_link,"utf8mb4");

Then run the following dbmod.php script (run once from Price Tapestry installation folder (e.g. /pt/dbmod.php) and then delete the file:

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
$sql "SHOW TABLES LIKE '".$config_databaseTablePrefix."%'";
  
database_querySelect($sql,$rows);
  foreach(
$rows as $row)
  {
    
$table array_pop($row);
    
$sql "ALTER TABLE `".$table."`
            CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
;
    print 
$sql."\n";
    
database_queryModify($sql,$result);
  }
  print 
"Done.\n";
?>

Finally, re-import all feeds to complete the conversion. If that's not the case and your WordPress installation has the default DB_CHARSET setting of 'utf-8' let me know and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by j.whittlesea@bt... on Fri, 2018-02-09 09:00

Hi
the character set is correctly mysqli_set_charset($database_link,"utf8");
but looked at the feed utilities and found the item set as

0.9 " Mini speaker Visaton K 23 SQ 8 Ω

with Merchant Category Brand as Conrad Electronic HiFi Speakers Visaton

so it is the "Ω" character.

Best way to remove would be to add this to the exceptions?

Many thanks for your help

Jeff

Submitted by support on Fri, 2018-02-09 09:41

Hello Jeff,

The Ω (ohm) character is actually quite important in the context of a loudspeaker product - I would be happy to look into the encoding issue further with you (I assume WordPress configuration is also utf8 and not utf8mb4) however rather than except the character you could add a Search and Replace filter to the Product Name field either for this feed or as a Global Filter, using Search:

Replace:

ohm

Cheers,
David.
--
PriceTapestry.com