SimpleCart
9 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 2, 2012 (RSS)
By kdub718 - June 13, 2012 - edited: June 13, 2012
I think this is the code for it... or am I missing it and its in the schema somewhere?
<!-- add to cart -->
<?php
$formName = "addform" . $record['num'];
$cartItems = array(
array(
'name' => $record['name'],
'unitPrice' => $record['price'],
'recordNum' => $record['num'],
'tableOrTag' => '_sc_example_products',
'quantity=' => '_sc_quantity',
),
//array('name' => 'Color: Blue', 'OPTION' => TRUE),
//array('name' => 'Region: North', 'OPTION' => TRUE),
//array('name' => 'Size: Xl', 'OPTION' => TRUE),
);
?>
<form method="post" name="<?php echo $formName ?>" action="?">
<input type="hidden" name="_sc_action" value="add">
<?php sc_createAddFormData($cartItems); ?>
<input type="text2" name="_sc_quantity" size="5" maxlength="5" value="0" /><br/>
<a href="#" title="Add to Cart" class="addToCart" onclick="document.forms.<?php echo $formName ?>.submit(); return false;">Add to Cart</a><br />
</form>
<!-- /add to cart -->
Re: [kdub718] SimpleCart
By robin - June 14, 2012
You can tell simple cart where to send the user by using "_sc_nextUrl". If you add something this to your form it should return to the current page.
<input type="hidden" name="_sc_nextUrl" value="?">
Hope that helps,
Robin
Programmer
interactivetools.com
Re: [robin] SimpleCart
By kdub718 - June 14, 2012
Re: [kdub718] SimpleCart
By kdub718 - June 26, 2012 - edited: June 26, 2012
But if I'm in a section like domain.com/mainlink.php?categoryname# and click it, it returns me to domain.com/mainlink.php? doesn't leave me in the category.
Any ideas for returning me back to the category I was in?
I'm guessing because the value is "?"
Re: [kdub718] SimpleCart
By robin - June 27, 2012
You could add the category to the next_url. Like:
<input type="hidden" name="_sc_nextUrl" value="?<?php echo $category; ?>">
Or use the "REQUEST_URI" server variable
<input type="hidden" name="_sc_nextUrl" value="<?php echo $_SERVER['REQUEST_URI']; ?>">
Hope that helps,
Robin
Programmer
interactivetools.com
Re: [robin] SimpleCart
By kdub718 - June 27, 2012
So the 2nd option work perfectly thanks.
I was chatting with dave and he said your the programmer that programmed the cart. So he said I should talk to you. I wanna remove the payment/paypal option. Basically just want the orders to be emailed.
Re: [kdub718] SimpleCart
By robin - June 27, 2012
What is your setup right now? Is the user re-directed to Paypal on submit?
Thanks
Programmer
interactivetools.com
Re: [robin] SimpleCart
By kdub718 - June 27, 2012
Re: [kdub718] SimpleCart
By Jason - July 2, 2012
What we can do is create a custom override function that tells the cart that the order has been paid (even though no payment has taken place), and then it follows through the normal process of sending out the emails.
One thing to note with this, is that it won't collect all the normal billing and shipping information that paypal gets for you. If you still need that information, we can set that up as well.
If you're interested in this, please email consulting@interactivetools.com and we'll go over some options.
Thanks
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/