Hello,
> but only in Dutch (my standard language) I can see the vehicle fitment.
Try to replace the function getProductRestrictions with:
public function getProductRestrictions($productId)
{
$restrictions = $this->_getProductRestrictions($productId);
if (count($restrictions) == 0 && defined('WPML_PLUGIN_PATH')){
$trPIds = $this->getTranslatedIds(array($productId));
foreach($trPIds as $trPId){
$restrictions = $this->_getProductRestrictions($trPId);
if (count($restrictions) > 0){
break;
}
}
}
return $restrictions;
}
public function _getProductRestrictions($productId)
{
$productId = (int) $productId;
$select = "
SELECT make, model, year_from, year_to
FROM {$this->_mainTable}
WHERE product_id = {$productId}
ORDER BY make
";
return (array) $this->_wpdb->get_results($select, ARRAY_A);
}
in the file:
wp-content/plugins/ymm-search/Model/Db.php
Stanislav
We will try this tomorrow.
I have another issue that I didn’t see in the staging site.
I uploaded a new product in my standard language, put in the specific vehicle in the YMM tab. Then I translated with WPML in 5 other languages. Then everything gets show in the other languages when selecting the vehicle in the ymm selector.
But if I copy this product to make another similair product for another vehicle there is something strange.
I put the other specifiq vehicle in the YMM tab. I translate in the 5 languages.
Now I select this specifiq vehicle through te ymm selector the product doesn’t show.
I dont understand the difference for the ymm selector for a totally new product and a copied product.
Is there a solution for this?
kind regards,
Archie van Creij
We replaced the function getProductRestrictions with the code you supplied. That seems to resolve the problem.
Hope you also have a solution for the products we copy, like I wrote yesterday
kind regards,
Archie van Creij