WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Ultra Simple Paypal Shopping Cart
WordPress Ultra Simple Paypal Shopping Cart with custom fields (10 posts)

  1. Amro Eldewiny
    Member
    Posted 1 year ago #

    Hi

    how can i get PRODUCT-NAME and PRODUCT-PRICE in custom fields

    the php code with this plugin like this

    <?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>

    I made 2 custom fields in my wordpress dashboard and i maked the code in page like this

    <?php echo print_wp_cart_button_for_product(array(
    										 get_post_meta($post->ID,'PRODUCT-NAME',true),
    										 get_post_meta($post->ID,'PRODUCT-PRICE',true),
    								)); ?>

    but it did't work so
    how can i handle the with custom fields ??

    http://wordpress.org/extend/plugins/wp-ultra-simple-paypal-shopping-cart/

    [Bump after 1 hour?? Please be aware that these are FREE volunteer-staffed forums - if you need faster help, consider hiring someone http://jobs.wordpress.net/ ]

  2. Amro Eldewiny
    Member
    Posted 1 year ago #

    I meded like the for the price and it's work but for the product name no

    <?php $values = do_shortcode( get_post_meta( $post->ID , 'PRODUCT-PRICE' , false ) ); ?>
    								<?php if($values && is_array($values)) : ?>
    								<?php foreach( $values as $meta) : ?>
    								<p><?php echo $meta ?></p>
    								<?php endforeach; ?>
    								<?php endif; ?>
  3. Amro Eldewiny
    Member
    Posted 1 year ago #

    how can i make PRODUCT-PRICE and PRODUCT-NAME in $values

  4. Amro Eldewiny
    Member
    Posted 1 year ago #

    Thank you everybody how help but sorry no one help enywey

    the right code it will be like the

    <?php $price = get_post_meta( $post->ID, 'PRODUCT-PRICE', true ); ?>
    Price: $<?php echo get_post_meta($post->ID, 'PRODUCT-PRICE', true); ?>
    Product Name: <?php echo get_post_meta($post->ID, 'PRODUCT-NAME', true); ?>
    <?php $name = get_the_title(); ?> <?php echo print_wp_cart_button_for_product($name, $price); ?>
  5. deepbevel
    Member
    Posted 1 year ago #

    how are you doing shipping? I'm using code like yours, but I can't get the value for shipping as set in the plugin settings to show in the cart.

    I can get a shipping value with get_post_meta, but I don't want a shipping value for each item, trying to get one value for the entire purchase.

    i suppose I could try the paypal shipping option..but would rather not.

    any advice?

    thanks

  6. deepbevel
    Member
    Posted 1 year ago #

    okay, didn't understand before but I get it now.. if you add 0.001 as the value for the product, then specify a value in the plugin shipping setting, it then applies that value in the settings to the entire purchase regardless of the number of items. Hooray!

    so, I have $15 as the value in the plugin settings, this is my code:

    <?php
    $productid =  get_post_meta($post->ID,'size_format_1',true); ?>
    <?php echo get_post_meta($post->ID,'size_format_1',true); ?>
    <?php
    $price = get_post_meta($post->ID,'price_1',true);?>
    &nbsp;
    <?php echo get_post_meta($post->ID,'price_1',true);?>
    
    <?php $shipping = get_post_meta($post->ID,'shipping_1',true);?>
    
    <?php
    echo print_wp_cart_button_for_product("$productid", "$price",  "$shipping"); ?>

    and now, the shipping is $15 no matter how many items.

  7. deepbevel
    Member
    Posted 1 year ago #

    for the sake of clairity,
    I have "0.001" as the value for my "shipping_1" custom field. And so, because I have "15" as the value in the plugin settings, it returns a single shipping price of $15.

  8. revo 3vom
    Member
    Posted 1 year ago #

    Amro Eldewiny

    Genius

    Thanks!!!

  9. revo 3vom
    Member
    Posted 1 year ago #

    Do you know how to make this work with the variations fields? Any help would be greatly appreciated

  10. deepbevel
    Member
    Posted 1 year ago #

    haven't tried that, but I would think maybe make a feild for it, then make $variation equal the fields value.

    $variation = get_post_meta($post->ID,'variation_1',true);

    then:

    echo print_wp_cart_button_for_product("$productid", "$price",  "$shipping", "$variation");

    ??

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic