Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] "osC_GiftWrap_v1.0"


Guest

Recommended Posts

Does anyone know how to remove the gift wrapping option for certain products? I want to remove the option in combination with the gift voucher modification. I'm using it as electronic gift certificates that aren't shipped, so there won't be any gift wrapping available.

 

I also can't seem to get the shipping option off, even though I have stated the weight of the product as 0. :huh:

 

Any help would be greatly appreciated. Thanks.

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 143
  • Created
  • Last Reply

Top Posters In This Topic

Ive just installed this module on a MS2 store and am having no amount of troubles...

 

the tax from the giftwrap isnt adding itself to the total tax instead its listing as a seperate item:

 

Sub-Total:  $76.99AUD

(Gift Wrap):  $5.50AUD

Flat Rate (Best Way):  $5.50AUD

Total:  $87.99AUD

GST 10%:  $7.50AUD

10:  $0.50AUD

 

anyone have any ideas whats goign on there?

Link to comment
Share on other sites

Has anyone fixed this problem?

-Neil

 

Ok. I lied. I do seem to have one problem.

 

During checkout, in CHECKOUT_SHIPPING.PHP, if you change the Giftwrap selection, it also changes the shipping options (ie. from First Class to Priority or vice versa) as well.

 

I assume that they are both using the same variable or function or something, but I can't figure out what that would be.

 

Ideas?

 

Phil

 

 

It's a javascript problem - the script the shipping is using is the same as the giftwrap. My work-around was to create a duplicate version of the javascript and replacing shipping with giftwrap. Here's the code for catalog/checkout_shipping.php:

 

around line 215 - replace

<script language="javascript"><!--
var selected;

function selectRowEffect(object, buttonSelect) {
 if (!selected) {
   if (document.getElementById) {
     selected = document.getElementById('defaultSelected');
   } else {
     selected = document.all['defaultSelected'];
   }
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_address.shipping[0]) {
   document.checkout_address.shipping[buttonSelect].checked=true;
 } else {
   document.checkout_address.shipping.checked=true;
 }
}

function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>

 

with this

 

<script language="javascript"><!--
var selected;
var selectedgift;

function selectRowEffect(object, buttonSelect) {
 if (!selected) {
   if (document.getElementById) {
     selected = document.getElementById('defaultSelected');
   } else {
     selected = document.all['defaultSelected'];
   }
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_address.shipping[0]) {
   document.checkout_address.shipping[buttonSelect].checked=true;
 } else {
   document.checkout_address.shipping.checked=true;
 }
}

function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function selectRowEffectGift(object, buttonSelect) {
 if (!selectedgift) {
   if (document.getElementById) {
     selectedgift = document.getElementById('defaultSelectedGift');
   } else {
     selectedgift = document.all['defaultSelectedGift'];
   }
 }

 if (selectedgift) selectedgift.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selectedgift = object;

// one button is not an array
 if (document.checkout_address.giftwrap[0]) {
   document.checkout_address.giftwrap[buttonSelect].checked=true;
 } else {
   document.checkout_address.giftwrap.checked=true;
 }
}

function rowOverEffectGift(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffectGift(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

//--></script>

 

around line 361 replace this

 

          if ( ($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {
           echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
         } else {
           echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
         }

 

with this

 

          if ( ($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {
           echo '                  <tr id="defaultSelectedGift" class="moduleRowSelected" onmouseover="rowOverEffectGift(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffectGift(this, ' . $radio_buttons . ')">' . "\n";
         } else {
           echo '                  <tr class="moduleRow" onmouseover="rowOverEffectGift(this)" onmouseout="rowOutEffectGift(this)" onclick="selectRowEffectGift(this, ' . $radio_buttons . ')">' . "\n";
         }

 

That is what is working for me. Good Luck!

Link to comment
Share on other sites

  • 1 month later...

anyone know how to get rid of the brackets around the giftwrap info?

 

(No Gift Wrap): $0.00

 

I'd like to have

 

No Gift Wrap: $0.00

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Greetings Everyone,

 

I've moved around my checkout process and have taken the Giftwrap code from CHECKOUT_SHIPPING to CHECKOUT_PAYMENT. I moved all the code, but I seem to have either forgotten something or there's something inherently different the these two and I need to take something from the SHIPPING page over to the PAYMENT page. Unfortunately, I don't know what that is...

 

The Giftwrap section is displaying on the CHECKOUT_PAYMENT page properly and the selection seems to be working properly, but I don't show the giftwrapping in the Order Confirmation screen under the totals.

 

If anyone could provide even the slightest insight into this, I would be extremely greatful! :)

 

Forever learning,

Jeff

 

P.S. Smart, I think you don't have a DEFINE statement setup properly in your CHECKOUT_SHIPPING page under INCLUDES\LANGUAGES\ENGLISH.

Link to comment
Share on other sites

Smart (Scott),

 

I just found what your problem is. You must only have one Giftwrapping option enabled. If you do, then the TEXT_ENTER_GIFTWRAP_INFORMATION variable is called from an IF statement, but this variable is not in a DEFINE anywhere. Add the following to includes\languages\english\checkout_shipping.php:

 

define('TEXT_ENTER_GIFTWRAP_INFORMATION', '(your comments here)');

 

Hope this helps (and that you'll get this message or have solved your problem already.) :)

 

Peace,

Jeff

Link to comment
Share on other sites

Hi All,

Has anyone gotten all the changes together so a newbie like me can follow it?? I know everyone has worked hard but as a newbie it is hard to follow all these changes. I could really use this feature but an finding it too confusing to follow all the changes. Thanks Much for your assistance :)

Link to comment
Share on other sites

Ive just installed this module on a MS2 store and am having no amount of troubles...

 

the tax from the giftwrap isnt adding itself to the total tax instead its listing as a seperate item:

anyone have any ideas whats goign on there?

 

This was posted quite a while ago, but I don't see where an answer was given. Since I'm running into the same issue, I was wondering how it got solved.

 

Thanks for the help!

Adrienne

Link to comment
Share on other sites

  • 1 month later...

Okay Guys this is the first Time i post on this forum since i use it for years now, its time to give some knowledge back to you. My english is homebased so it try my best. I installed the giftwrap contrib, having the same problem with the the tax display, is solved it this way after a week of burning my face into my monitor. here are the results of the german jury: ;o)

 

look in /catalog/includes/modules/order_total/ot_giftwrap.php

 

original code

 

 ? ?function process() {
? ? ?global $order, $currencies;

? ? ?if (tep_not_null($order->info['giftwrap_method'])) {
? ? ? ?if (MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS > 0) {
? ? ? ? ?$giftwrap_tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS);

? ? ? ? ?$order->info['tax'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ? ?$order->info['tax_groups']["{$giftwrap_tax}"] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ? ?$order->info['total'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);

? ? ? ? ?if (DISPLAY_PRICE_WITH_TAX == true) $order->info['giftwrap_cost'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ?}

? ? ? ?$this->output[] = array('title' => $order->info['giftwrap_method'] . ':',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => $currencies->format($order->info['giftwrap_cost'], true, $order->info['currency'], $order->info['currency_value']),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'value' => $order->info['giftwrap_cost']);
? ? ?}
? ?}

 

just replace with this peace

function process() {
? ? ?global $order, $currencies;
? ? ?
? ? ? ? if (tep_not_null($order->info['giftwrap_method'])) {
? ? ? ?if (MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS > 0) {
? ? ? ? ?$giftwrap_tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS);
? ? ? ? ?$giftwrap_tax_description = tep_get_tax_description(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
? ? ? ? ?

? ? ? ? ?$order->info['tax'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ? ?$order->info['tax_groups']["{$giftwrap_tax_description}"] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ? ?$order->info['total'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);

? ? ? ? ?if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['giftwrap_cost'] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);
? ? ? ?}

? ? ? ?$this->output[] = array('title' => $order->info['giftwrap_method'] . ':',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => $currencies->format($order->info['giftwrap_cost'], true, $order->info['currency'], $order->info['currency_value']),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'value' => $order->info['giftwrap_cost']);
? ? ?}
? ?}

 

after all ist not very tricky, the original code dont gets the tax description, "tep_get_tax_description" , i added the line and put the "$giftwrap_tax_description" into :

$order->info['tax_groups']["{$giftwrap_tax_description}"] += tep_calculate_tax($order->info['giftwrap_cost'], $giftwrap_tax);

 

thats all @ my site.

 

Have fun

Edited by dragonfly73
Link to comment
Share on other sites

  • 2 weeks later...
Hi,

 

I was wondering if this contrib is easy to change to something else. I would like to have a pulldown with options you can select in the checkoutprocess.

So instead of choosing a giftwrap yes or no, I want to change it to "choice 1, choice 2, choice 3, etc in a pulldown that's easy to edit.

 

Someone got an answer to this? ;)

 

Thanks in advance

 

 

Has this ability been solved??? I would love to do something like this, even if it is done with ratios or checkboxes.

 

Thanks for any help in advanced

Link to comment
Share on other sites

I'm sorry to ask this question again, but does anyone know how I can add fields to the giftwrap options? using ratio or checkboxes? Even if someone can help me add just one, I could get the rest in.

 

Many thanks

Link to comment
Share on other sites

  • 1 month later...

Here's a fix for the problem where you see only the giftwrap option, but not the "no giftwrap" option (i.e. you have no radio buttons):

 

Fix for missing "no giftwrap" option

 

Note that this probably also solves some of the linked-to-shipping-choices problems people have experienced.

 

Regards,

 

--Grayson

Edited by grayson

Grayson Morris

Link to comment
Share on other sites

anyone know how to get rid of the brackets around the giftwrap info?

 

(No Gift Wrap): $0.00

 

I'd like to have

 

No Gift Wrap: $0.00

To get rid of the parentheses around "(Gift Wrap)" and "(No Gift Wrap)", go into catalago/checkout_shipping.php and find this:

			if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {
		  $giftwrap_info = array('id' => $giftwrap_info,
								 'title' => $quote1[0]['module'] . ' (' . $quote1[0]['methods'][0]['title'] . ')',
								 'cost' => $quote1[0]['methods'][0]['cost']);

change to this:

			if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {
		  $giftwrap_info = array('id' => $giftwrap_info,
								 'title' => $quote1[0]['module'] . ' ' . $quote1[0]['methods'][0]['title'],
								 'cost' => $quote1[0]['methods'][0]['cost']);

 

The change is on the third line of this snippet. (The same method can be used to get rid of the parentheses around shipping terms by making the same change on the respective line in the shipping modules section in the same file.) Note that you can also replace the single space between 'module' and 'title' with a dash or any other separator, if desired.

 

Regards,

 

--Grayson

Grayson Morris

Link to comment
Share on other sites

Another fix.

 

PROBLEM: On catalog/checkout_shipping.php when DISPLAY_PRICE_WITH_TAX is true, the gift wrap cost is NOT shown with tax included. (This is the page where the customer chooses via radio buttons whether he or she wants gift wrapping.)

 

REASON: The function process() in ot_giftwrap.php computes and stores the giftwrap cost including tax when DISPLAY_PRICE_WITH_TAX is true; this function is however not called until checkout_confirmation.php. The with-tax value is thus not yet directly available in checkout_shipping.php.

 

SOLUTION: Make the following changes to checkout_shipping.php.

 

Replace

<td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>

<?php

if ( ($quotes1_size > 1) || ($n2 > 1) ) {

?>

<td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>

<td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'], $checked); ?></td>

<?php

} else {

?>

<td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id']); ?></td>

<?php

}

?>

with

<td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>

<?php

if ( ($quotes1_size > 1) || ($n2 > 1) ) {

 

if (DISPLAY_PRICE_WITH_TAX == true) {

$gift_tax_rate_tmp = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS);

$gift_tax_amt_tmp = $quotes1[$i]['methods'][$j]['cost'];

$gift_tax_amt_tmp += tep_calculate_tax($quotes1[$i]['methods'][$j]['cost'], $gift_tax_rate_tmp);

?>

<td class="main"><?php echo $currencies->format($gift_tax_amt_tmp); ?></td>

<?php

} else {

?>

<td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>

<?php

}

?>

<td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'], $checked); ?></td>

<?php

} else {

?>

<td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id']); ?></td>

<?php

}

?>

Be sure to enter the giftwrap cost in the Admin panel WITHOUT tax -- for example, if you want to charge EUR 1.25 in total, including tax, you should enter EUR 1.05 in the Admin panel for giftwrap cost. (For those of you who are wondering why you'd want to do this, in many European countries customers are always shown prices including VAT (value-added tax = sales tax); thus all product prices, shipping costs, and other expenses must be shown including VAT rather than having it calculated at the very end and added on.)

 

Regards,

 

--Grayson

Edited by grayson

Grayson Morris

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

hello, i am having a little problem with the giftwrap contribution:

 

when a customer enters the checkout_shipping page he can select between "giftwrap" and "no giftwrap". "giftwrap" is selected by default, but i want "no giftwrap" to be the default value. i already tried to change the sort order of these two options in admin -> modules -> giftwrap, but "giftwrap" still appears on top and is selected by default. why can't i sort these options?

Link to comment
Share on other sites

Hi guys,

I just installed this, and enabled it in the admin section.

 

When i go to checkout_shipping.php , all I can see for the Gift Wrap section is this:

 

GiftWrap

 

TEXT_ENTER_GIFTWRAP_INFORMATION

No Gift Wrap $0.00

 

I have re-done this contrib 3 times, following exactly what the instructions said.

 

Any ideas ?

 

Thanks,

Steve

Link to comment
Share on other sites

Since I do not charge for giftwrap I do not want to show which giftwrap method my customers choose in the order total. It makes no sense to show giftwrap in the order total table when not charging them for giftwrap. To remove this I did not activate giftwrap in admin -> modules -> order total.

 

But I would like to show giftwrap method in admin/orders.php (and packing slip, invoice and so on) together with payment method, shipping address and so on.

 

Would be very thankful if someone can help me with this. I can't figure out how to show giftwrap method outside the order total table. How can I get the value from the database?

Link to comment
Share on other sites

Found it. Just added some of the code in includes/classes/order.php to admin/includes/classes/order.php

 

But.. I can't get sorting to work in checkout_shipping.php even though I have set the sorting in admin. I do not want "giftwrap: yes" checked.

Link to comment
Share on other sites

  • 2 months later...

I'm installing this contribution and I also want a checkbox instead of 2 methods to choose from. I do not need it for a giftwrap but for other order options.

 

I will change some code in checkout_shipping.php and let you know the progress.

 

Not terrific this contribution as it uses the shipping module for a option yes / no but I did not find anything better in the contributions list.

 

Didier.

Link to comment
Share on other sites

  • 3 weeks later...

Hi Everyone,

 

I'm having a little trouble installing the contribution. I have no errors. The problem is I don't see the check boxes on the catalog/checkout_shipping.php page. I have enabled Gift Wrap and No Gift Wrap under the Modules section of the admin. I have also enabled Gift wrap under OrderTotal. I'm open to suggestions.

 

Thanks,

Barb

Link to comment
Share on other sites

  • 3 weeks later...
Did anyone download and install this? I would really like some feedback.

Thanks.

-R

 

------------------------

Hope you can assist - I want to make the default toggle for Giftwrap to be 'No Gift Wrap' on the checkout page - how might I do this?

Link to comment
Share on other sites

hello, i am having a little problem with the giftwrap contribution:

 

when a customer enters the checkout_shipping page he can select between "giftwrap" and "no giftwrap". "giftwrap" is selected by default, but i want "no giftwrap" to be the default value. i already tried to change the sort order of these two options in admin -> modules -> giftwrap, but "giftwrap" still appears on top and is selected by default. why can't i sort these options?

 

 

Has anybody found a solution for the sorting problem with the Gift Wrap Modification????? Any help would be great!!!!!

Link to comment
Share on other sites

Has anybody found a solution for the sorting problem with the Gift Wrap Modification????? Any help would be great!!!!!

 

The sort doesn't work for me either. I'm not sure what the issue is.

Barb

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...