تخطي الملاحة

Open

Reported for: إضافة WPML Multilingual CMS 4.5.14

Topic Tags: Compatibility

Overview of the issue

If you are logged out of a site that uses Jetpack, whenever you try to add a product to the cart in a secondary language, you get a 404 error.

Workaround

There are two possible workarounds, but please be sure to make a full backup of your website before proceeding.

Workaround #1: Edit Jetpack

  1. Open the …/wp-content/plugins/jetpack/modules/woocommerce-analytics/classes/class-jetpack-woocommerce-analytics-universal.php file.
  2. Replace:
    $referer_postid = isset( $_SERVER['HTTP_REFERER'] ) ? url_to_postid( esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) ) : 0;
    

    With

    $referer_postid = $_POST["add-to-cart"];
    
    

Workaround #2: Edit WPML

  1. Open the …wp-content/plugins/wpml-string-translation/classes/slug-translation/RewriteRules/Hooks.php file.
  2. Replace:
    		if ( ! $this->cache ) {
    			$this->cache = $this->factory->create()->rewrite_rules_filter( $value );
    		}
    

    With

    //		if ( ! $this->cache ) {
    			$this->cache = $this->factory->create()->rewrite_rules_filter( $value );
    //		}
    

ترك رد

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

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