• Hi scroutz requested that we give them the weigh of each product

    Για ένα προϊόν με βάρος 3.2kg, η τιμή του πεδίου βάρους θα είναι:

    <weight>3200</weight>
    ή

    <weight>3.2 kg</weight>

    Αλλά το Plugin δεν βγάζει αυτό το πεδίο.

    Ευχαριστώ

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sostoss

    (@sostoss)

    From what i’ve read it is a new scroutz request, any updates?

    Thank you

    Plugin Author mpbm23

    (@mpbm23)

    This needs a new update. Although it will take a while before it is implemented.

    Hello,
    This is very usefull if can be added to a future update.
    (As soon as posible) hehe!

    Έκανα τις εξής αλλαγές στο createsk.php και δουλεύει μια χαρά το πεδίο “weight”.
    Συγκεκριμένα:

    1. Μετά τη γραμμή κώδικα
    $skus = $wpdb->get_results($skusql);

    πρόσθεσα

    $weightsql = $wpdb->prepare(  "SELECT *
    	FROM " . $wpdb->prefix . "postmeta
    	WHERE <code>post_id</code> =" . $prod->ID . " AND <code>meta_key</code> LIKE '_weight';",0);
      $weights = $wpdb->get_results($weightsql);

    2. Μετά τη γραμμή κώδικα
    $sku = $skus[0];

    πρόσθεσα
    $weight = $weights[0];

    και
    3. Μετά από εδώ

     if (strcmp($attr[0]->meta_value, "a:0:{}")) {
                    $product->addChild('size', substr($sizestring, 0, -2));
                }

    πρόσθεσα

     $product->weight = NULL;            
      $product->weight->addCData($weight->meta_value);

    και φυσικά στο αντίστοιχο πεδίο κάθε προϊόντος συμπλήρωσα το βάρος.

    • This reply was modified 6 years, 11 months ago by disi13.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘weight field’ is closed to new replies.