Topic RSS
With the FatFreeCart version…
Open up single.php (or singlesale.php, depending on your setup).
Find the following:
$thumb = get_post_meta($post->ID, 'pi1', $single = true); // check for product thumbs
$thumb2 = get_post_meta($post->ID, 'pi2', $single = true); // check for product thumbs
$thumb3 = get_post_meta($post->ID, 'pi3', $single = true); // check for product large image
$pli = get_post_meta($post->ID, 'pli', $single = true); // check for item price
$price = get_post_meta($post->ID, 'price', $single = true); // check items specs
$specs = get_post_meta($post->ID, 'specs', $single = true); ?>
We'll add in one new line for the custom field "price2".
$thumb = get_post_meta($post->ID, 'pi1', $single = true); // check for product thumbs
$thumb2 = get_post_meta($post->ID, 'pi2', $single = true); // check for product thumbs
$thumb3 = get_post_meta($post->ID, 'pi3', $single = true); // check for product large image
$pli = get_post_meta($post->ID, 'pli', $single = true); // check for item price
$price = get_post_meta($post->ID, 'price', $single = true); // check for item price2
$price2 = get_post_meta($post->ID, 'price2', $single = true); // check items specs
$specs = get_post_meta($post->ID, 'specs', $single = true); ?>
Now go down to where you see "End Vcart" code. Underneath paste the following chunk of code.
if($price2 !== '') { ?>
<!–Start Second Item Cart Code–>
<form action="https://www.e-junkie.com/ecom/fgb.php?c=cart&cl=1&ejc=2" target="ej_ejc" method="POST">
<!– paypal email(remove if not using PayPal) –>
<input type="hidden" name="business" value="<?php bloginfo('admin_email'); ?>"/>
<!– google merchant id (remove if not using Google Checkout) –>
<input type="hidden" name="merchant_id" value="your_google_merchant_id"/>
<!– site url –>
<input type="hidden" name="site_url" value="<?php bloginfo('url'); ?>"/>
<!– contact email (where we can notify of the updates) –>
<input type="hidden" name="contact_email" value="<?php bloginfo('admin_email'); ?>"/>
<!– item name –>
<input type="hidden" name="item_name" value="<?php the_title(); ?>"/>
<!– item number (should be different for each product)–>
<input type="hidden" name="item_number" value="<?php the_ID(); ?>"/>
<!– item price –>
<input type="hidden" name="amount" value="<?php echo $price; ?>"/>
<!– initial quantity –>
<input type="hidden" name="quantity" value="1"/>
<!– item options (can be removed if not required) –>
<table>
<tr>
<td><input type="hidden" name="on0" value="Size (if required)"/>
Size (if required)</td>
<td><select name="os0" class="field" >
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
</select>
</td>
</tr>
<tr>
<td><input type="hidden" name="on1" value="Color (if required)"/>
Color (if required)</td>
<td><select name="os1" class="field">
<option value="Red">Red</option>
<option value="White">White</option>
<option value="Blue">Blue</option>
<option value="Orange">Orange</option>
<option value="Tan">Tan</option>
</select>
</td>
</tr>
</table>
<!– Edit and uncomment these if you wish to include them. See http://www.fatfreecart.com/code.html for more info
<input type="hidden" name="shipping" value="1">
<input type="hidden" name="shipping2" value="0.5">
<input type="hidden" name="handling" value="0.5">
<input type="hidden" name="tax" value="0.50"/>
–>
<!– following options are applicable to whole cart–>
<!– you thank you page –>
<input type="hidden" name="return_url" value="<?php bloginfo('url'); ?>"/>
<!– any custom info you want to pass for the whole order –>
<input type="hidden" name="custom" value="anything"/>
<!– currency (USD for Google Checkout USA, GBP for Google Checkout UK. For PayPal: any currency that PayPal supports –>
<input type="hidden" name="currency_code" value="USD"/>
<input type="image" src="<?php bloginfo('template_directory'); ?>/imgs/addcart2.gif" border="0" onClick="javascript:return EJEJC_lc(this.parentNode);">
</form>
<!–End 2nd Cart Code–>
<?php } // end if statement
// if there's not a second price
else { echo ''; } ?>
What this will do is create a second add to cart button if you specify a second price. You will want to create a new image and put it in your images folder, calling it "addcart2.gif" Make sure the image defines the difference between the different add to cart options (in your case bag and box).
Now in your posts create a new custom field with a key of "price2" and set the value to whatever your price may be, just like setting the regular price custom field.
Most Users Ever Online: 40
Currently Online:
16 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Member Stats:
Guest Posters: 428
Members: 2252
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 2983
Posts: 16042
Newest Members: Allsed, deleteduser, shanm, slidesketch, jimharrison, vmi
Moderators: Market Admin (5051)
Administrators: Market Admin (5051)

Log In
Register
Home
Offline


