تخطي الملاحة

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the WoodMart theme‘s “WooCommerce Layout Builder,” custom layouts with category-based conditions only apply to categories in the primary language.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

1. Set Translation Preferences:

  • Go to WPML > Settings > Post Types Translation and set Layouts (woodmart_layout) to Translatable.
  • Go to WPML > Settings > Custom fields and set wd_layout_conditions to Copy.

2. Edit Code in Woodmart Theme

  • Open: /wp-content/themes/woodmart-alpha/inc/modules/layouts/class-single-product.php
  • Look for line 15
  • Replace:
    	public function check( $condition, $type = '' ) {
    		global $post;
    
    		$is_active = false;
    
  • With:
    	public function check( $condition, $type = '' ) {
    		global $post;
    
    		$is_active = false;
    
    		 // WPML Workaround for compsupp-7668 
    		$condition['condition_query'] = apply_filters( 'wpml_object_id', $condition['condition_query'], $condition['condition_type'] );
    

ترك رد

يُرجى البقاء في الموضوع والتزام الاحترام للآخرين. إذا كنت بحاجة إلى مساعدة بشأن المشكلات التي لا تتعلق بهذا المنشور، فاستخدم منتدى الدعم لبدء محادثة أو إرسال تذكرة.

يمكنك استخدام هذه العلامات:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>