• Smat Placid

    (@www_smatplacid_com)


    I needed besides SKU and PRICE more fields.

    ATTENTION: after update the plugin the changes are gone – editing core files!

    Anyone who else needs this, follow this instructions:

    Open the file [PLUGIN-PATH -> wp-order-cart -> wpordercart.php]
    Go to line ~89 “function add_products_metaboxes()” and duplicate a “add_meta_box” and change bold-entries:

    add_meta_box(‘wpordercart_products_fabrikat‘, ‘Hersteller‘, array($this, ‘wpordercart_products_fabrikat_gethtml’), ‘products’, ‘normal’, ‘high’);

    Then go to line ~97 “function wpordercart_products_price_gethtml()” and duplicate the whole function – change 3 times “price” and the _e label ‘<label for=”price” >’; _e(“Preis “‘

    Then go to line ~152 “$products_meta[‘price’] = $_POST[‘price’];” and duplucate this, taking ur own values (in this case change 2 times “price”)

    Now, if u refresh the backend and make all correct, u see under the content ur new field. To output that field, goto [PLUNING_DIR -> Templates -> product.php] (for single view) and add:

    <?php $my_value = get_post_meta($post->ID, “my-fieldname”, true); if ($my_value != “”) { echo ” <tr> <td style=’font-weight:bold;’ >Label: </td> <td colspan=’2′ >” . $my_value . “</td> </tr> “; } ?>

    Feel free to ask.

    https://www.ads-software.com/plugins/wp-order-cart/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Smat,

    a question for you. I added a field same as Quantity on product page, where customer can enter a desired discount.

    Would you know, how to add the Discount field into the Cart?

    Thanks.

    Thread Starter Smat Placid

    (@www_smatplacid_com)

    You want a new field, which u added already into product-page, into the “cart”, right ?

    Let me check that later, will give you a feedback latest tomorrow.

    Regards, Smat

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add custom fields’ is closed to new replies.