i can only find one for the rabobank on github now.
]]>If the next item is not at the specified quantity, then the item is not discounted.
Thanks All
]]>I was about to get really pissed off and whine that there was no option for ID=”” in the add_to_cart form… but then I tried it and it worked. (Chris or CT admins should add this to the notes)
http://cartthrob.com/docs/tags_detail/add_to_cart_form/index.html
Now I am dumb as a rock, so when I make sites I want it simple.
I use a JS validator for most of my forms that requires ID, hence my initial anger, until I discovered it works.
Here is the link to the JS I use for validation: http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
This one satisfies all my cart throb needs because it can check for things numerical vs text entries etc, and compare 2 fields like “same password” in the passwords fields, etc.
Here is my simple JS code for the add to cart form:
JS-tag
//You should create the validator only after the definition of the HTML form
var frmvalidator = new Validator("validate");
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("quantity","req","Please enter Number of tickets");
frmvalidator.addValidation("quantity","num", "Please Use Numbers Only");
frmvalidator.addValidation("quantity","leelmnt=hidden1","Please select {tickets_remaining} tickets or less");
[removed]
/JS-tag
I do not want to allow the user to enter a number that is higher than the inventory. I do this by comparing it to a hidden field. Here is my CT code:
{exp:cartthrob:add_to_cart_form
entry_id="{entry_id}"
return="{segment_1}/cart"
id="validate"}
<label >Seats:</label>
// Use a little bit of inline JS to let them know how many items are left.
// Some thing like this onclick="if (this.value == 'Maximum {tickets_remaining}') {this.value='';}"
// Since my validator is set to numbers only prevents accidental clicks. But when they click on the field the text disappears
<input name='quantity' class="quantity" type="number" max="{tickets_remaining}" value="Maximum {tickets_remaining}" />
</div>
// hidden field that has the number of items that the validator compares it too, prevents people from entering more items than there are left
<input name='hidden1' type="hidden" value="{tickets_remaining}" />
<input type='submit' class="button1" value='Register >' />
{/exp:cartthrob:add_to_cart_form}
Now JS isn’t full proof, but this is a clean way to avoid those EE error pages.
Hope this helps someone!
:D
]]>
<input type="hidden" value="my data here" name="order_notes" />
$event_id = $this->EE->cartthrob->cart->order('order_notes');
All of these work fine though:
$order_id = $this->EE->cartthrob->cart->order('order_id');
$first_name = $this->EE->cartthrob->cart->order('first_name');
$last_name = $this->EE->cartthrob->cart->order('last_name');
$company = $this->EE->cartthrob->cart->order('company');
$card_type = $this->EE->cartthrob->cart->order('card_type');
Should I be doing something else?
]]>I’m trying to work with the ‘product_reduce_inventory’ hook (http://cartthrob.com/docs/developers/hooks/index.html#product_reduce_inventory), but am having trouble - it appears as though Cartthrob does not call that hook for 3rd party extensions.
In Cartthrob_product.php, around line 58 is the reduce_inventory() method, which sets a core hook ‘product_reduce_inventory’, which is defined in Cartthrob_core_ee.php, around line 956. However within this method, there is no attempt to look for another extension registered to that hook (e.g. $this->EE->extensions->active_hook(‘product_reduce_inventory’) etc…).
Should I be attempting to use this hook in another manner?
Cheers,
John
p.s. I’m trying to use this hook to change the status of a product to “Closed” if the inventory gets reduced to zero. Am I’m on the right track?
]]>I’m looking to get some custom extension work done - Hope it’s ok to post this here.
Basically I need some database tables updating from within the on_authorize hook. If it was just in php I could do it, but I haven’t touched codeignitor before, so I’m looking for someone who could write the code. Let me know your rates - you can PM if you prefer.
Thanks
Andy
]]>I found an add-on called CT Admin that offers some immediate printing options (invoices, reports) and then saw that Chris N was evaluating a copy (http://cartthrob.com/forums/viewthread/2738/). Looks like a pretty good solution for some of the missing parts within CT.
Wondering if anyone has experience with the add-on? Chris, did you get a chance to evaluate it?
]]>