Gijs van Egmond Posted February 29, 2008 Posted February 29, 2008 Hello, I'm making a project where I have the following problem: At some products I added the option Send/Pick up with the two attributes Send and Pick up. Now I'd like if someone orders that products (doesnt matter if there's more products contained in the order where this option doesnt exist) that checkout_shipping will be skipped and the customer will be redirected to checkout_payment. Following is my idea, but I dont know how to write the code exactly (especially how to ask if the attribute is selected and which) in checkout_shipping.php: if option id = 1(send/receive) exists { if attribute id = 1(Send) { save shippingmethod as shipping and redirect to checkout_payment} else if attribute id = 2(Pick up) {save shippingmethod as pick up and redirect to checkout_payment} } And I'd like to, if attribute Send is selected, that OrderTotal will not show Sendingcosts, cause it is already calculated with the attribute. Does someone has an idea for me? Please reply
satish Posted February 29, 2008 Posted February 29, 2008 In shipping You have $cart as an variable. so place a code to check for looping thru the cart for that attribute. If found internally you set cart wt as zero and apply code logic. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
Gijs van Egmond Posted February 29, 2008 Author Posted February 29, 2008 Hey man, thanks for your fast reply. But I do not completely understand you. I know there's $cart. So I check in $cart if the attribute exists. But how? And why setting cartweight zero? It is always zero, I dont work with weight. :) Sorry mate, but you're not very clear or I'm not very smart :)
Gijs van Egmond Posted March 3, 2008 Author Posted March 3, 2008 Anyone? I googled and googled this weekend but didn't make any progress.
satish Posted March 3, 2008 Posted March 3, 2008 $arr_cart=$catr->get_products() Now this array has $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], 'final_price' => ($products_price + $this->attributes_price($products_id)), 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '')); put this array in a loop and chek value of attributes. If it matches set a flag for free shipping and return a quote of zero. Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.