• Hello,

    I use the wpml modified ymm module.

    my website is translated in 6 languages using WPML

    The vehicle fitment tab is only showing in the languages that is my standard language.

    I can find the products in other languages using the ymm selector but only in Dutch (my standard language) I can see the vehicle fitment.

    What do you recommend to solve this issue?

    kind regards,

    Archie van Creij
    http://www.bunkerparts.nl

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    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

    Thread Starter archievancreij

    (@archievancreij)

    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

    Thread Starter archievancreij

    (@archievancreij)

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Vehicle fitment show in multiple language’ is closed to new replies.