Jump to content
Tsimi

Giftwrapping for osC GOLD and normal

Recommended Posts

Hi there,

 

I've got this strange problem: the giftwrap module is working fine, but it calculates the fee twice. So when I have a 0,50 fee, it counts 1,- fee.

 

does anyone know what could be causing the problem?

Share this post


Link to post
Share on other sites

@@Tsimi

 

Hi Lambros

 

Just a thought, maybe not possible.

But with gift wrapping how about adding like per item say 2.50 per item cart conatians say 10 items, total wrapping cost would be 22.50. We got caught the customer had about 21 items, all to be gift wrapped with the current "system" the cost was 2.50  ( for about 1 1/2 hours work, not the best hourly rate)

 

Just a thought.

 

Cheers

Grandpa

Share this post


Link to post
Share on other sites

@@grandpaj

 

Hi John

 

21 items! You sold 21 items!? Congratulations! :thumbsup:

I haven't looked at the gift wrapping module in a while let me go refresh my memory by playing around with it and I report back.

Share this post


Link to post
Share on other sites

@@grandpaj

 

Hi John

 

I think we have a solution for your problem. Harald was in the chat and helped me out with this.

The theory was clear to me but I couldn't figure out how to look for items in the cart but we got it at the end and here is the code.

Just backup your old gift wrap module file, uninstall your current gift wrap module. Then copy&paste the code from the below link.

Then install again the module. Now you should be able to switch between Flat Rate (default setting) and Per Item. Please try it out and if all is good I will upload it to the Addons area.

 

Gift wrap Module

Share this post


Link to post
Share on other sites

@@Tsimi

 

Hi Lambros.

 

B R I L L I A N T works like a charm. Many thanks, Im sure others will find this a usful addon.

 

Kind regards

 

Grandpa

Share this post


Link to post
Share on other sites

@@grandpaj

 

:thumbsup:

 

Great, thanks for the feedback.

I'll upload it to the Addons area then. Around this time of year it might be useful to some out there.

Thanks again.

Share this post


Link to post
Share on other sites

@@grandpaj

 

Here some additional changes regarding the message text in the checkout_shipping.php page.

 

Replace your language definitions with these here.

// BOF GIFTWRAP
define('TEXT_GIFTWRAP', 'Gift Wrapping Service');
define('TEXT_HAVE_YOUR_ORDER_GIFT_WRAPPED', 'Have your products giftwrapped.');
define('TEXT_GIFTWRAP_FEE_FLAT_RATE', 'An additional fee of %s will be added to your order.');
define('TEXT_GIFTWRAP_FEE_PER_ITEM', 'An additional fee of %s <u>per item</u> will be added to your order.');
// EOF GIFTWRAP

then open your checkout_shipping.php

 

FIND

<!-- BOF GIFTWRAP //-->
<?php
if (MODULE_ORDER_TOTAL_ALLOW_GIFTWRAP == 'true') {
?>
<div class="col-sm-6 col-xs-12 pull-right alert alert-success">
<?php
	$gift_price = $currencies->display_price(MODULE_ORDER_TOTAL_GIFTWRAP_FEE, tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']));

	echo '<i class="fa fa-gift fa-2x"> </i><strong>' . TEXT_GIFTWRAP . '</strong><br>' . TEXT_HAVE_YOUR_ORDER_GIFT_WRAPPED;
    echo '<div style="float:right;">' . tep_draw_checkbox_field('gift_wrap', '1', false) . '</div>';
	if (MODULE_ORDER_TOTAL_GIFTWRAP_FEE > 0) echo '<br /><small>' . sprintf(TEXT_GIFTWRAP_FEE, $gift_price) . '</small>';
?>	
</div>
<div class="clearfix"></div>
<?php
}
?>
<!-- EOF GIFTWRAP //-->

REPLACE WITH

<!-- BOF GIFTWRAP //-->
<?php
if (MODULE_ORDER_TOTAL_ALLOW_GIFTWRAP == 'true') {
?>
<div class="col-sm-6 col-xs-12 pull-right alert alert-success">
<?php
	$gift_price = $currencies->display_price(MODULE_ORDER_TOTAL_GIFTWRAP_FEE, tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']));

	echo '<i class="fa fa-gift fa-2x"> </i><strong>' . TEXT_GIFTWRAP . '</strong><br>' . TEXT_HAVE_YOUR_ORDER_GIFT_WRAPPED;
    echo '<div style="float:right;">' . tep_draw_checkbox_field('gift_wrap', '1', false) . '</div>';
	if (MODULE_ORDER_TOTAL_GIFTWRAP_FEE > 0) {
		if (MODULE_ORDER_TOTAL_PER_ITEM_GIFTWRAP == 'Flat Rate') {	
			echo '<br /><small>' . sprintf(TEXT_GIFTWRAP_FEE_FLAT_RATE, $gift_price) . '</small>';
		} else {
			echo '<br /><small>' . sprintf(TEXT_GIFTWRAP_FEE_PER_ITEM, $gift_price) . '</small>';
		}	
	}
?>	
</div>
<div class="clearfix"></div>
<?php
}
?>
<!-- EOF GIFTWRAP //-->

That will switch the messages for Per Item and Flat Rate.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi

 

Hi Lambros

 

Thanks for the update.

Works well, as you know, if someone can "break" something its me. This addon seems to be "bullet proof".

Here's another wee idea for your next update maybe, have a max value. Not important just a thought.

 

Many thanks for the addon. Check it out on our site. I think you know the URL

 

Cheers

 

Grandpa

Share this post


Link to post
Share on other sites

Hi there.

 

This seemed easy to install, but it's not showing on the confirmation page and not adding the fee to the total!

 

The option shows correctly on the checkout shipping page, it's configured correctly on admin without overlapping the sort order of the other installed modules and before the total.

I check the option for gift wrap, but it doesn't show on confirmation page.

 

I revised the installation over and over again and for the life of me I cannot find anything wrong!

 

Can somebody help, please??? I've wasted over 2 hours on this already, thinking it wouldn't take more than 15 minutes to install it and getting it working. :(

 

I'm using normal v2.3.4.

 

BTW, the instructions file seems to be missing stuff. The text wasn't showing correctly on the checkout shipping page, but after I used the manual upgrade instructions, it did show fine.

 

Tks for any help here, guys! :)


Patty

Share this post


Link to post
Share on other sites

@@Patty

 

I just installed this into a fresh osC EDGE shop and it worked just fine.

Please re-check your code changes/additions in the checkout_shipping.php and checkout_process.php files.

It is easy to make a mistake there. Some code exist in 3 different places but only one of them is the correct one.

Share this post


Link to post
Share on other sites

OMG!! I'm so silly!!

 

That did the trick, Tsimi! The very first part of the changes on checkout_shipping.php was wrong. There are 2 instances of

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

and I located just the first one around line 60 when I should've gone for the one on line 109.

 

To avoid this type of confusion for others maybe you should change the instructions a little bit and instead of that line of code that shows in 2 different places, maybe use this one:

if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {

and add the code right ABOVE or BEFORE it.

 

Anyway, thank you so much for your help and quick reply.

Wonderful contribution, by the way! Thank you for sharing! :)


Patty

Share this post


Link to post
Share on other sites

@@Patty

 

Great that it worked out. :thumbsup:

 

Yeah, this addon sure could use an update maybe a header tags module for the checkout shipping stuff? :rolleyes:

Need to find time to look into it once.

Share this post


Link to post
Share on other sites

Hi @Tsimi

Great addon. Any chance for an update to Phoenix 1.0.3.0.

And maybe campatible to work with the points and rewards addon from Raiwa. 

  

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

×