WP Order Cart
Add custom fields (3 posts)

  1. Smat Placid
    Posted 2 years ago #

    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.


  2. Mikoyan
    Posted 1 year ago #


    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?


  3. Smat Placid
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic