CartThrob Forums http://cartthrob.com/forums/ CartThrob Forums en Copyright 2013 2013-02-20T00:08:52-08:00 Ideal http://cartthrob.com/forums/viewthread/8431/ http://cartthrob.com/forums/viewthread/8431/#When:00:08:52Z <p>where did the <a href="http://cartthrob.com/?URL=https%3A%2F%2Fgithub.com%2Fho-nl%2Fee_cartthrob_ideal_lite">https://github.com/ho-nl/ee_cartthrob_ideal_lite</a> go?</p> <p>i can only find one for the rabobank on github now.</p> 2013-02-20T00:08:52-08:00 Discount plugin for percentage/amount off per item quantity threshold http://cartthrob.com/forums/viewthread/7548/ http://cartthrob.com/forums/viewthread/7548/#When:10:03:16Z <p>I’m looking for a discount that will check each item in the cart and apply a discounted rate if the item is at or above a specified quantity.</p> <p>If the next item is not at the specified quantity, then the item is not discounted.</p> <p>Thanks All</p> 2012-12-12T10:03:16-08:00 Validating your add_to_cart form or check_out form with JavaScript quick set up. http://cartthrob.com/forums/viewthread/7174/ http://cartthrob.com/forums/viewthread/7174/#When:00:41:53Z <p>The more I work with cart throb the more I love it.</p> <p>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) <br /> <a href="http://cartthrob.com/?URL=http%3A%2F%2Fcartthrob.com%2Fdocs%2Ftags_detail%2Fadd_to_cart_form%2Findex.html">http://cartthrob.com/docs/tags_detail/add_to_cart_form/index.html</a></p> <p>Now I am dumb as a rock, so when I make sites I want it simple. <br /> I use a JS validator for most of my forms that requires ID, hence my initial anger, until I discovered it works.</p> <p>Here is the link to the JS I use for validation: <a href="http://cartthrob.com/?URL=http%3A%2F%2Fwww.javascript-coder.com%2Fhtml-form%2Fjavascript-form-validation.phtml">http://www.javascript-coder.com/html-form/javascript-form-validation.phtml</a></p> <p>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.</p> <p>Here is my simple JS code for the add to cart form:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">JS</span><span style="color: #007700">-</span><span style="color: #0000BB">tag<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//You&nbsp;should&nbsp;create&nbsp;the&nbsp;validator&nbsp;only&nbsp;after&nbsp;the&nbsp;definition&nbsp;of&nbsp;the&nbsp;HTML&nbsp;form<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">frmvalidator&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Validator</span><span style="color: #007700">(</span><span style="color: #DD0000">"validate"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">frmvalidator</span><span style="color: #007700">.</span><span style="color: #0000BB">EnableMsgsTogether</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">frmvalidator</span><span style="color: #007700">.</span><span style="color: #0000BB">addValidation</span><span style="color: #007700">(</span><span style="color: #DD0000">"quantity"</span><span style="color: #007700">,</span><span style="color: #DD0000">"req"</span><span style="color: #007700">,</span><span style="color: #DD0000">"Please&nbsp;enter&nbsp;Number&nbsp;of&nbsp;tickets"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">frmvalidator</span><span style="color: #007700">.</span><span style="color: #0000BB">addValidation</span><span style="color: #007700">(</span><span style="color: #DD0000">"quantity"</span><span style="color: #007700">,</span><span style="color: #DD0000">"num"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Please&nbsp;Use&nbsp;Numbers&nbsp;Only"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">frmvalidator</span><span style="color: #007700">.</span><span style="color: #0000BB">addValidation</span><span style="color: #007700">(</span><span style="color: #DD0000">"quantity"</span><span style="color: #007700">,</span><span style="color: #DD0000">"leelmnt=hidden1"</span><span style="color: #007700">,</span><span style="color: #DD0000">"Please&nbsp;select&nbsp;{tickets_remaining}&nbsp;tickets&nbsp;or&nbsp;less"</span><span style="color: #007700">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">[removed]<br /></span><span style="color: #007700">/</span><span style="color: #0000BB">JS</span><span style="color: #007700">-</span><span style="color: #0000BB">tag&nbsp;</span> </span> </code></div> <p>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:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">{exp</span><span style="color: #007700">:</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">:</span><span style="color: #0000BB">add_to_cart_form&nbsp;<br />&nbsp;&nbsp;entry_id</span><span style="color: #007700">=</span><span style="color: #DD0000">"{entry_id}"&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #007700">return=</span><span style="color: #DD0000">"{segment_1}/cart"<br />&nbsp;&nbsp;</span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #DD0000">"validate"</span><span style="color: #0000BB">}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">label&nbsp;</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Seats</span><span style="color: #007700">:&lt;/</span><span style="color: #0000BB">label</span><span style="color: #007700">&gt;&nbsp;<br /></span><span style="color: #FF8000">//&nbsp;Use&nbsp;a&nbsp;little&nbsp;bit&nbsp;of&nbsp;inline&nbsp;JS&nbsp;to&nbsp;let&nbsp;them&nbsp;know&nbsp;how&nbsp;many&nbsp;items&nbsp;are&nbsp;left.&nbsp;&nbsp;<br />//&nbsp;Some&nbsp;thing&nbsp;like&nbsp;this&nbsp;onclick="if&nbsp;(this.value&nbsp;==&nbsp;'Maximum&nbsp;{tickets_remaining}')&nbsp;{this.value='';}"<br />//&nbsp;Since&nbsp;my&nbsp;validator&nbsp;is&nbsp;set&nbsp;to&nbsp;numbers&nbsp;only&nbsp;prevents&nbsp;accidental&nbsp;clicks.&nbsp;But&nbsp;when&nbsp;they&nbsp;click&nbsp;on&nbsp;the&nbsp;field&nbsp;the&nbsp;text&nbsp;disappears&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">input&nbsp;name</span><span style="color: #007700">=</span><span style="color: #DD0000">'quantity'&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"quantity"&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #DD0000">"number"&nbsp;</span><span style="color: #0000BB">max</span><span style="color: #007700">=</span><span style="color: #DD0000">"{tickets_remaining}"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"Maximum&nbsp;{tickets_remaining}"&nbsp;&nbsp;</span><span style="color: #007700">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br /></span><span style="color: #FF8000">//&nbsp;hidden&nbsp;field&nbsp;that&nbsp;has&nbsp;the&nbsp;number&nbsp;of&nbsp;items&nbsp;that&nbsp;the&nbsp;validator&nbsp;compares&nbsp;it&nbsp;too,&nbsp;prevents&nbsp;people&nbsp;from&nbsp;entering&nbsp;more&nbsp;items&nbsp;than&nbsp;there&nbsp;are&nbsp;left<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">input&nbsp;name</span><span style="color: #007700">=</span><span style="color: #DD0000">'hidden1'&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #DD0000">"hidden"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"{tickets_remaining}"&nbsp;&nbsp;</span><span style="color: #007700">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">input&nbsp;type</span><span style="color: #007700">=</span><span style="color: #DD0000">'submit'&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"button1"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">'Register&nbsp;&nbsp;&gt;'&nbsp;</span><span style="color: #007700">/&gt;<br /></span><span style="color: #0000BB">{</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">:</span><span style="color: #0000BB">add_to_cart_form}&nbsp;</span> </span> </code></div> <p>Now JS isn’t full proof, but this is a clean way to avoid those EE error pages.</p> <p>Hope this helps someone!</p> <p>:D</p> 2012-10-30T00:41:53-08:00 Using custom order field with extension. http://cartthrob.com/forums/viewthread/6013/ http://cartthrob.com/forums/viewthread/6013/#When:07:55:04Z <p>Hi, I’m saving some data in the custom ‘order_notes’ field in ‘orders’ channel by adding </p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">&lt;</span><span style="color: #0000BB">input&nbsp;type</span><span style="color: #007700">=</span><span style="color: #DD0000">"hidden"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"my&nbsp;data&nbsp;here"&nbsp;</span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #DD0000">"order_notes"&nbsp;</span><span style="color: #007700">/&gt;&nbsp;</span> </span> </code></div> to checkout_form and it works fine but I’m unable to acces it from my custom extension with on_authorize hook like so:<div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">$event_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'order_notes'</span><span style="color: #007700">);&nbsp;</span> </span> </code></div> <p>All of these work fine though:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">$order_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'order_id'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$first_name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'first_name'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$last_name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'last_name'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$company&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'company'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$card_type&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">EE</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cartthrob</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cart</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">order</span><span style="color: #007700">(</span><span style="color: #DD0000">'card_type'</span><span style="color: #007700">);&nbsp;</span> </span> </code></div> <p>Should I be doing something else?</p> 2012-08-13T07:55:04-08:00 Trying to use hook ‘product_reduce_inventory’ http://cartthrob.com/forums/viewthread/5815/ http://cartthrob.com/forums/viewthread/5815/#When:08:51:00Z <p>Hi Chris,</p> <p>I’m trying to work with the ‘product_reduce_inventory’ hook (<a href="http://cartthrob.com/?URL=http%3A%2F%2Fcartthrob.com%2Fdocs%2Fdevelopers%2Fhooks%2Findex.html%23product_reduce_inventory">http://cartthrob.com/docs/developers/hooks/index.html#product_reduce_inventory</a>), but am having trouble -&nbsp; it appears as though Cartthrob does not call that hook for 3rd party extensions.</p> <p>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.&nbsp; However within this method, there is no attempt to look for another extension registered to that hook (e.g. $this-&gt;EE-&gt;extensions-&gt;active_hook(‘product_reduce_inventory’) etc…).</p> <p>Should I be attempting to use this hook in another manner?</p> <p>Cheers,<br /> John</p> <p>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.&nbsp; Am I’m on the right track?</p> 2012-07-15T08:51:00-08:00 hook for dynamically/on-the-fly password protecting or watermarking a download protected file http://cartthrob.com/forums/viewthread/5330/ http://cartthrob.com/forums/viewthread/5330/#When:15:11:35Z <p>I would like to set a password or create a watermark on-the-fly using pdftk when a customer uses the protected download link to get their purchased pdf. The input for the password or the watermark would be the customers name. Is there a hook that could be made available or one that is suggested? This would be akin to ejunkie’s pdf stamping mechanism. Any suggestions on how to proceed?</p> 2012-04-22T15:11:35-08:00 HSBC payment plugin http://cartthrob.com/forums/viewthread/4736/ http://cartthrob.com/forums/viewthread/4736/#When:05:08:18Z <p>Hi, anyone had any joy with a HSBC payment plugin for the UK? PM me with details if you are available to help me out?</p> 2012-02-10T05:08:18-08:00 Anyone available to build an extension? http://cartthrob.com/forums/viewthread/4535/ http://cartthrob.com/forums/viewthread/4535/#When:04:49:07Z <p>Hello</p> <p>I’m looking to get some custom extension work done - Hope it’s ok to post this here.</p> <p>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.</p> <p>Thanks</p> <p>Andy</p> 2012-01-18T04:49:07-08:00 CT Admin http://cartthrob.com/forums/viewthread/3170/ http://cartthrob.com/forums/viewthread/3170/#When:10:33:39Z <p>I’m looking at options for printing packing slips to send with each shipment.&nbsp; Unfortunately, exporting to Quickbooks is a pain, especially as the customer base grows (if anyone can suggest a quick way, please do so!), so a solution withing EE/CT would be preferred.&nbsp; I’m on a Mac, so the <a href="http://cartthrob.com/?URL=https%3A%2F%2Fsecure.consolibyte.com%2Fsaas%2Fsignup%2F%3Fstage%3Dhome%2Ffocus%26application%3Dcartthrob%23">ConsoliBYTE</a> solution doesn’t work for me.</p> <p>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 (<a href="http://cartthrob.com/?URL=http%3A%2F%2Fcartthrob.com%2Fforums%2Fviewthread%2F2738%2F">http://cartthrob.com/forums/viewthread/2738/</a>).&nbsp; Looks like a pretty good solution for some of the missing parts within CT.</p> <p>Wondering if anyone has experience with the add-on?&nbsp; Chris, did you get a chance to evaluate it?</p> 2011-07-28T10:33:39-08:00 Buy # for $ discount http://cartthrob.com/forums/viewthread/2945/ http://cartthrob.com/forums/viewthread/2945/#When:17:49:48Z <p>Is it possible to setup a discount where a customer can buy, for example, two products for $35 (set price, not $ off)? I was looking at the get X for X but that doesn’t seem like the correct discount.</p> 2011-07-07T17:49:48-08:00