Jump to content
Sign in to follow this  
Ian

[Contribution] Credit Class/Gift voucher/Discount Coupon v5

Recommended Posts

welp, it's not working. I don't get errors, just that shipping fees are still applied to the GIFT$$ items. I set the weight for physical items, and weight of 0 for virtual items. Only I don't use weight to determine shipping fees, I use a table and determine shipping based on the number of items in the cart. Likely this is conflicting?

Chris

not sure.. try this,

in catalog/checkout_shipping.php

below these line

<!-- header_eof //-->

<!-- body //-->

put in <script>alert ( <?php echo $cart->content_type; ?> )</script>

try check out, and there will be a pop up windows,

see what value you got. That will help with the debuggin.


shyang

Share this post


Link to post
Share on other sites

welp, it's not working. I don't get errors, just that shipping fees are still applied to the GIFT$$ items. I set the weight for physical items, and weight of 0 for virtual items. Only I don't use weight to determine shipping fees, I use a table and determine shipping based on the number of items in the cart. Likely this is conflicting?

Chris

not sure.. try this,

in catalog/checkout_shipping.php

below these line

<!-- header_eof //-->

<!-- body //-->

put in <script>alert ( <?php echo $cart->content_type; ?> )</script>

try check out, and there will be a pop up windows,

see what value you got. That will help with the debuggin.

Did you define these values in catalog/includes/add_ccgvdc_application_top.php

 

define('NO_COUNT_ZERO_WEIGHT', '1');

define('MINIMUM_WEIGHT','0.1');


shyang

Share this post


Link to post
Share on other sites

welp, it's not working. I don't get errors, just that shipping fees are still applied to the GIFT$$ items. I set the weight for physical items, and weight of 0 for virtual items. Only I don't use weight to determine shipping fees, I use a table and determine shipping based on the number of items in the cart. Likely this is conflicting?

Chris

not sure.. try this,

in catalog/checkout_shipping.php

below these line

<!-- header_eof //-->

<!-- body //-->

put in <script>alert ( <?php echo $cart->content_type; ?> )</script>

try check out, and there will be a pop up windows,

see what value you got. That will help with the debuggin.

Did you define these values in catalog/includes/add_ccgvdc_application_top.php

 

define('NO_COUNT_ZERO_WEIGHT', '1');

define('MINIMUM_WEIGHT','0.1');

 

Thanks for tackling this beast.

hmm...that didn't change anything. Didn't get the popup either. Strange. Other thoughts? If it helps, the URL to the site is http://www.annickscoffee.com/store/

 

Chris

Share this post


Link to post
Share on other sites
Thanks for tackling this beast.

hmm...that didn't change anything. Didn't get the popup either. Strange. Other thoughts? If it helps, the URL to the site is http://www.annickscoffee.com/store/

Chris

 

Your Gift voucher is recognized as the 'physical' item.

Which means your product model might not be GIFTxx,

or your catalgoincludesclassesshopping_cart.php file was not configure right.

Are you really really sure that the product model of your Gift Voucher is GIFTxxx? (I am not 100% sure if it is case sentitive, but to reduce problem, just assume it is.)

Send your catalogincludesclassesshopping_cart.php and catalogcheckout_shipping.php to shyang@shyang.biz.


shyang

Share this post


Link to post
Share on other sites

I was having a few problems with the virtual product recognition. Mainly because my client only sets weights on things that will affect the cost of shipping. i.e. things that don't weigh much he doesn't set to anything.

 

Anyhoo,

 

I have altered the code to recognise the GIFT string specifically. THis method might be useful for others having problems ....

 

in classes/shopping_cart.php

 

// ICW ADDED CREDIT CLASS - Begin

         } elseif ($this->show_weight() == 0) {

           reset($this->contents);

           while (list($products_id, ) = each($this->contents)) {

	 

             $virtual_check_query = tep_db_query("select products_weight, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");

             $virtual_check = tep_db_fetch_array($virtual_check_query);

             if ($virtual_check['products_weight'] == 0) {

               switch ($this->content_type) {

                 case 'physical':

                   $this->content_type = 'mixed';



                   return $this->content_type;

                   break;

                 default:

       if (ereg('^GIFT', $virtual_check['products_model'])) {

  	 $this->content_type = 'virtual';

  	 }

                   else

     $this->content_type = 'virtual_weight';

                   break;

               }

             } else {

               switch ($this->content_type) {

                 case 'virtual':

                   $this->content_type = 'mixed';



                   return $this->content_type;

                   break;

                 default:

                   $this->content_type = 'physical';

                   break;

               }

             }

           }

// ICW ADDED CREDIT CLASS - End

 

also in checkout_shipping I removed the reference to virtual_weight as it was picking up all the zero weighted products

 

i.e.

 

// ICW CREDIT CLASS GV AMENDE LINE BELOW 

$cart->get_content_type(); 

if ($cart->content_type == 'virtual') {

 

 

 

 

Smashing contribution Ian.

Share this post


Link to post
Share on other sites

also I noticed another little problem ...

 

I don't recall a fix in the thread so far ....

 

in classes/order_total.php there was a .= missing causing the checkbox not to be displayed.

 

this is the fixed code

 

if ( ($use_credit_string !='' ) || ($selection_string != '') ) {

             $output_string .=  '<tr colspan="4"><td colspan="4" width="100%">' .  tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';              

             $output_string .= ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "n" .

                              '   <td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .

                              '     <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;

             $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

             $output_string .= '  </tr>' . "n"; 

             $output_string .= $selection_string;

           }

Share this post


Link to post
Share on other sites

I was running all around this post and the forum looking for that tidbit. I could not figure out why it was not showing the checkbox.

I was just about to delve into order_totals.php myself, thankfully I didn't have to do that!

This fixes the checkbox not showing up (one of the .= was actually a = in the file)

Thanks!

Share this post


Link to post
Share on other sites

Hi,

 

I didn' try everything out with v5.03 and I did not miss the checkbox. But I changed the code and now I have a ckeckbox I haven't before.

 

Thank you

 

Devon

Share this post


Link to post
Share on other sites

Thanks for tackling this beast.

hmm...that didn't change anything. Didn't get the popup either. Strange. Other thoughts? If it helps, the URL to the site is http://www.annickscoffee.com/store/

Chris

 

Your Gift voucher is recognized as the 'physical' item.

Which means your product model might not be GIFTxx,

or your catalgoincludesclassesshopping_cart.php file was not configure right.

Are you really really sure that the product model of your Gift Voucher is GIFTxxx? (I am not 100% sure if it is case sentitive, but to reduce problem, just assume it is.)

Send your catalogincludesclassesshopping_cart.php and catalogcheckout_shipping.php to shyang@shyang.biz.

 

OUTSTANDING! I went back through catalogincludesclassesshopping_cart.php and sure enough, there was stuff missing. (Probably a result of other mods to the same file :oops: .) Replaced several pieces of code and it works. Thank you all so much for your help.

 

Chris

Share this post


Link to post
Share on other sites
Hi,

 

I didn' try everything out with v5.03 and I did not miss the checkbox. But I changed the code and now I have a ckeckbox I haven't before.

 

Thank you

 

Devon

 

Odd. I get a duplicate text field for entering the disount code. I put it back the way it was. Do the text fields actually do different things?

 

Chris

Share this post


Link to post
Share on other sites
OUTSTANDING! I went back through catalogincludesclassesshopping_cart.php and sure enough, there was stuff missing. (Probably a result of other mods to the same file .) Replaced several pieces of code and it works. Thank you all so much for your help.

 

Don't you have then problems with the tax? When I give my products no weight no tax is calculated and shipping is okay (no shipping method shows up). With weight tax is calculated and a shipping method shows up. My products name is GIFT-A-10, GIFT-B-20 (the A, B, C.. for sort order reasons.)

 

Devon

Share this post


Link to post
Share on other sites

Hi,

 

My problem with the CC Gift Voucher module is that the tax is being applied to subtotal before the coupon discount. That means the tax is being calculated on the subtotal before any amount has been subtracted from it. The taxes, however, should be applied to subtotal after coupon discount, meaning it should be calculated on the new lesser subtotal amount.

 

Does anyone know how to fix this problem? Do I have to install 5.04 to fix it? I'd rather not have to if it's a simple code change.

 

Thank you.

Jason

Share this post


Link to post
Share on other sites

in admin - modules - order total the tax must be set before the coupon and gift voucher.

Thats the way I have it and it works fine.

 

Modules Sort Order Status Action

 

Sub-Total 1

Shipping 2

Cash on Delivery Fee 3

Tax 4

Discount Coupons none

Gift Vouchers 5

Low Order Fee none

Total 6

 

Devon

Share this post


Link to post
Share on other sites
in admin - modules - order total the tax must be set before the coupon and gift voucher.

Thats the way I have it and it works fine.

 

Modules Sort Order Status Action

 

Sub-Total 1      

Shipping 2      

Cash on Delivery Fee 3  

Tax 4      

Discount Coupons    none  

Gift Vouchers 5      

Low Order Fee     none  

Total 6

 

Devon

 

Thanks.

 

Here's what we have:

Sub-Total: 1

Discount Coupons: 2

Shipping: 3

Tax: 4

Total: 5

 

Here's an example order total output:

Sub-Total: $165.00

Discount Coupon: test: $16.50

Shipping Costs (Fedex): $5.00

8% PST + 7% GST: $24.75

Total: $178.25

 

Problem 1 - Taxes are only applied to Sub-Total and not after Discount Coupon is applied

Problem 2 - Total is off

 

Here's what we have flagged in Modules - Discount Coupon:

Display Total : True

Sort Order: 2

Include Shipping: False

Include Tax: False

Re-calculate Tax: True

 

Any ideas?

 

THanks,

Jason

Share this post


Link to post
Share on other sites

Hello,

 

I can't seem to find a way to have taxes apply AFTER Discount Coupon has been applied to sub-total.

 

Most of the posts on this forum imply that taxes are applied before the Discount coupon.

 

Is is possible to have the Taxes applied after the Discount Coupon has been apllied to Sub-Total?

 

Thanks,

Ivar

Share this post


Link to post
Share on other sites

Here my options in gift voucher

 

Gift Vouchers

 

Display Total

true

 

Sort Order

5

 

Queue Purchases

true

 

Include Shipping

true

 

Include Tax

true

 

Re-calculate Tax

None

 

Tax Class

German Normal

 

Credit including Tax

false

 

Order Total Modules :

Modules Sort Order Status Action:

 

Sub-Total 1

Shipping 2

Cash on Delivery Fee 3

Tax 4

Gift Vouchers 5

Total 6

 

Since I want the tax calculated on sub-total and shipping and cod fee I have to set it after this methods. Since I don't want tax on the gift voucher I set the gift voucher after the tax. I only calculate tax on the tree method who are b e f o r e the tax sort order.

 

 

After purchasing

---

1 x GIFT-B-10 10.00 EUR

1 x HORNY (F) 17.50 EUR

---

sub total: 27.50 EUR

German Post: 4.10 EUR

tax included 16%: 4.36 EUR

Total: 31.60 EUR

 

After redeeming a gift voucher of 5 Euro:

 

Purchase

1 x HORNY (F) 17.50 EUR

 

invoice

 

Sub Total: 17.50 EUR

German Post: 4.10 EUR

included tax 16%: 2.98 EUR

Gift Vouchers: 5.00 EUR

Summe: 16.60 EUR

 

Devon

 

www.octopuzz.de

Share this post


Link to post
Share on other sites

Hello all,

 

I am having a bit of trouble with credit class/gv ver 5.03. First of all using Internet Explorer 6, the redeem button on checkout_payment.php does not appear while using netscape it does appear. There are two sets of tick boxes and info boxes for the redeem coupon code. No matter what I check or code i use no deductions are showing up on the next confirmation page. Credits are just not being applied. Any helpful hints are greatly appreciated.

 

MJS

eSolutionist

Share this post


Link to post
Share on other sites

Hello again,

 

Well have made some progress, redeem button showing up in IE and Netscape. Have reddem box for discount coupon and gift voucher, and tick box to use voucher account. Still not getting any credits from redeem buttons. Not able to redeem voucher account, keeps asking to select a form of payment. I have read the reply with code to fix this bug nad have made the changes, still get same results.

 

MJS

Share this post


Link to post
Share on other sites

Hello again,

 

Have made even more progress...everything is working great except that the voucher balance does not decrease after using voucher account to pay for checkout.

 

Also, when emailing a gift voucher the link that is created to redeem does not go anywhere, left with hour glass of eternity.

 

MJS

Share this post


Link to post
Share on other sites

Hello,

 

Well I hope everyone else has as much fun as I do at 4am.

I have noticed in admin/customer/orders when purchase is made with credit voucher, the payment method does not appear nor does the total output reflect any discount.

 

Still havent licked the voucher balance not reducing thing.

 

MJS

Share this post


Link to post
Share on other sites

Hello,

 

Well I hope everyone else has as much fun as I do at 4am.

I have noticed in admin/customer/orders when purchase is made with credit voucher, the payment method does not appear nor does the total output reflect any discount.

 

Still havent licked the voucher balance not reducing thing.

 

MJS

Share this post


Link to post
Share on other sites

I installed the Credit Class and GV.......and now my orders dont show up in admin.Also i have no box to put my coupon code in during checkout.I enabled coupons in admin/modules/order total.Any help would be appreciated.Thanks

Share this post


Link to post
Share on other sites

Been a while since I was here, apart from being busy, the topic reply notifications seems to have gotten switched off.:(

 

For those having trouble with the tax calculations, 5.03 seems to have been a bit of a disaster here.

 

However 5.04 wil be released tonight. I'm just finishing the updated install docs.

 

There are full instructions for updating from 5.03. (not too difficult)

 

You also get the benefit of the new product/category restriction code.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×