Support » Plugin: Woo Zap Mirror » showing SHIPMENT_COST from product if it filled only

  • hi

    i use this code

    //fetch products automaticly
    add_action( 'wc_zap_mirror_xml_node', function( &$node, $product ) {
        $product_id = $product->get_id();
        $term_names = wp_get_post_terms( $product_id, 'product_brand', array('orderby'=>'name', 'fields' => 'names'));
        $term_names = implode(' ', $term_names);
    
    	$node->PRODUCT_NAME		= $product->get_name();
    	$node->DETAILS			= $product->get_description();
    	$node->CATALOG_NUMBER	= $product->get_sku();
    	$node->PRODUCTCODE  	= $product->get_id();
    	$node->PRICE			= $product->get_price();
        $node->SHIPMENT_COST	= '30';
    	$node->DELIVERY_TIME	= '7';
    	$node->MANUFACTURER		= $term_names;
    	$node->WARRANTY			= '12 months';
     
    }, 10, 2 ); 
    

    i need to add the option to show the SHIPMENT_COST from the product details if it is filed by client otherwise it will show the general price

    how can i do that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ido Friedlander

    (@idofri)

    Shipping costs are not managed in term of a single product.
    WooCommerce only let you use shipping classification per product.
    (Unless you use some other 3rd-party plugin that i’m not aware of)

    ido am talking about this
    http://prntscr.com/r1i8y4
    i need to make if else that says if it is fulled in the product zap settings then it won’t be 30 like in general

    hi @idofri pleae try to help me cause currently is is showing a global price for shipping to all the products although some of them have free shipping

    thanks advanced

    Plugin Author Ido Friedlander

    (@idofri)

    I’ve fixed the issue you’re referring to.
    You can get the updated version from the official repo: https://github.com/idofri/woo-zap-mirror
    I’ll release A new version ASAP.

    thanks for the update but it did not let me explain again
    right now in the general options for the site which i did in the functions.php i set the general cost for shipping which is

    
        $node->SHIPMENT_COST	=  '30';
    

    from other hand product which have in it own settings the cost is 0
    look here: http://prntscr.com/r37x80

    is still showing in the zap mirror 30 as in the general settings

    how can i add if command to tell the xml to show the product shipping cost if it is filled

    Plugin Author Ido Friedlander

    (@idofri)

    Stop using this filter-hook and use managed default attributes.

    well i need theme for case like this and i made my own code to help anyone who could need it

    //fetch products automaticly
    add_action( 'wc_zap_mirror_xml_node', function( &$node, $product ) {
        $product_id = $product->get_id();
    
    $shipping_price = '30';
    $zap_shipment = $product->get_meta( '_wc_zap_shipment' );
    $shipping_price = ($zap_shipment != '' ) ? $zap_shipment : $shipping_price;
    	
    
    	$node->PRODUCT_NAME		= $product->get_name();
    	$node->DETAILS			= $product->get_description();
    	$node->CATALOG_NUMBER	= $product->get_sku();
    	$node->PRODUCTCODE  	= $product->get_id();
    	$node->PRICE			= $product->get_price();
        $node->SHIPMENT_COST	=  $shipping_price;
    	$node->DELIVERY_TIME	= '7';	
    	$node->WARRANTY			= '12 months';
     
    }, 10, 2 ); 
    
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘showing SHIPMENT_COST from product if it filled only’ is closed to new replies.