Commit f646cb51 authored by Jonny Bradley's avatar Jonny Bradley

[FIX] cart: A few more fixes for the cart module, but the server-side code for...

[FIX] cart: A few more fixes for the cart module, but the server-side code for ajax_add_to_cart mode seems to be completely absent.
parent 466aae53
......@@ -167,7 +167,7 @@ function wikiplugin_addtocart_info()
function wikiplugin_addtocart( $data, $params )
{
global $cartlib, $headerlib; require_once 'lib/payment/cartlib.php';
global $cartlib, $headerlib, $prefs; require_once 'lib/payment/cartlib.php';
$headerlib->add_jsfile('lib/payment/cartlib.js');
if ( ! session_id() ) {
......@@ -242,7 +242,7 @@ function wikiplugin_addtocart( $data, $params )
}
if ( $ajax_add_to_cart == 'y' ) {
$headerlib->add_jq_onready("$('form.addProduct').cartAjaxAdd();");
$headerlib->add_jq_onready("$('.wp_addtocart_form').cartAjaxAdd();");
}
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
......
{* $Id$ *}
<form method="post" action="{query _type=relative _keepall=y}" style="display: inline;">
<form method="post" action="{query _type=relative _keepall=y}" style="display: inline;" class="wp_addtocart_form">
<input type="hidden" name="code" value="{$code|escape}">
{if $onbehalf == 'y'}
{tr}Buy on behalf of:{/tr}
......@@ -36,7 +36,7 @@
</tr>
{/if}
</table>
<input type="submit" class="btn btn-default" value="{$add_label|escape}" class="addProductToCartSubmit">
<input type="submit" class="btn btn-default" value="{$add_label|escape}">
{if $exchangeorderitemid && $exchangetoproductid}
<input type="hidden" value="{$exchangeorderitemid|escape}" name="exchangeorderitemid">
<input type="hidden" value="{$exchangetoproductid|escape}" name="exchangetoproductid">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment