Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[contribution] "osC_GiftWrap_v1.0"


143 replies to this topic

#1 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 12 April 2003, 18:36

===============================================

osC_GiftWrap Module v1.0

===============================================

OVERVIEW

There has always been a lack of solutions available for offering a GiftWrap Option for your customers orders. I found a few suggestions in the osC Forums, but they are more like "work-arounds", not the "REAL THING".

So, I decided to write one! I spent alot of time getting this to function correctly. It wasn't easy. Anyone that is familiar with the osCommerce checkout process knows what I mean.

If you find any bugs or errors, please email me.

I must say this, though... I was VERY disappointed when I posted messages here the osCommerce Forum asking for a bit of help when I got stuck... and absolutely NO ONE from the Community offered any assistance what-so-ever! :( So this is all me.

We should all be working together in the single goal of advancing this great product!

===============================================

WHAT WILL IT DO?

This GiftWrap Module Addon will provide the option of adding GiftWrap to the Order during the Checkout Process.

<- osCAdmin ->

This Addon contains...
1 new Order Total Module - ot_giftwrap.php
2 new GiftWrap Modules - giftwrap.php and nogiftwrap.php
1 new Class file - Gift.php

All of which are controlled via osCAdmin under Modules. You will see that a new GiftWrap Option will appear in osCAdmin under Modules and a new GiftWrap selection in Modules -> Order Totals. Each of these new Modules needs to be activated to work correctly! Make sure you adjust your Order Total Sort Options to display your Order Total options in the right order.

<- Checkout ->

A new box is created on the Checkout Shipping Page asking... "Would like to GiftWrap your Order?" There are two options, GiftWrap or No GiftWrap. Each with an associated cost configured in osCAdmin. The GiftWrap amount is applied to the Order and appears on the Checkout Confirmation Page, both in the Shipping Summary and in the Order Totals.

This same information will be included on the Customers Order Invoice and Packing Slip.

===============================================

REMARKS

Please remember that this is osC_GiftWrap Module v1.0!
I am presently working on a future release with more features, such as...

-> checkbox selection instead of the radio buttons.
-> Add a "GiftCard" Message - A Personalized Message or Greeting to the Recipient
-> Free GiftWrap with Purchase Amount
-> Choice of Wrapping Paper

If you have any suggestions to make this osC GiftWrap Module better, let me know... I am VERY open to suggestions. Please eMail me.

===============================================
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#2 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 12 April 2003, 18:37

Here is the link...

http://www.oscommerce.com/community/contributions,1155

Good Luck!

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#3 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 14 April 2003, 19:35

Did anyone download and install this? I would really like some feedback.

Thanks.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#4 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 14 April 2003, 22:00

I'll download it now and install it tonight, I'll get back with ya!

Thanks.
BTW I would have loved to help you when you needed it but I didn't know how to do it myself

#5 Conversion

  • Community Member
  • 9 posts
  • Real Name:Pure Conversion

Posted 14 April 2003, 23:28

Hi ugottasalsa

Allthough at the moment i have no need of this particular addin i did download after reading your posts asking if anyone had tested.

with some minor alterations to the install help text i did get it installed on a non live site with no major problems and from the little ability i have on local system for testing it seems for now ok.

Sugestion:
The folder sequence the files are supplied in is incorrect and while this may not matter to some it matters to some as well.

The written instructions while direct have a few errors that would make install for uninitiated awkward at the least.

I would sugest that you attempt to install from your directions to find the problems if possible on a clean osc copy.

Overall:
Excellant :)
The above faults while valid will not stop the addin from being used i am sure but the sugestions may help with any further releases.
Personally i think its great and if i ever have a need to wrap one of my houses or cars i will certainly look at this as the option to use :)

Good Job... CYA

#6 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 15 April 2003, 01:51

well I couldn't get it to work.
Doesn't have a radio button so the customer can choose and it doesn't charge giftwrap or shipping charges now.....If someone gets it loaded and it works, let me know. I can't figure it out!

#7 Conversion

  • Community Member
  • 9 posts
  • Real Name:Pure Conversion

Posted 15 April 2003, 10:38

Hi baresinsations,

The options for wrap or no wrap should be on the first page of the checkout system as the first option ( checkout_shipping.php )

The cost of wrapping $5.00 is carried through however it is not listed within the subtotals. (This should be altered to show the cost etc )

Anyways if you go through your instructions i think the ones needed are within the first few instructions given. You may find where you went wrong or a reason for its failure.

I am more than willing to help out if i can CyA :)

#8 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 15 April 2003, 15:44

I found a few of my mistakes and now all is working but the sort order. I do not want Yes Gift Wrap on top and set as default. I just haven't got this one to work correctly even though I used the sort order on the giftwrap modules.

#9 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 15 April 2003, 16:07

Got everything working now thanks to Randy.

#10 kmcar

  • Community Member
  • 83 posts
  • Real Name:Kevin Carolan

Posted 22 April 2003, 01:31

Quote

Got everything working now thanks to Randy.

How did you handle the non exisiting code that ya need to look for.

Example

CATALOG/CHECKOUT_SHIPPING.PHP

<?php
if (tep_count_shipping_modules() > 0) {
?>

I went line for line and did not find that line. Did I miss something. I know it's late and I have been working for 18 hours. Just would like to offer my customers gift wrap.

Any Help would be appericated.


:lol:

Thanks

kmcar

#11 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 22 April 2003, 02:23

Kevin,

I'm on vacation right now and not at my desktop so I'm not sure what I did. Ask Randy maybe he'll remember. As far as the code you are referring to. It is there, that wasn't where I was having a prob at.

#12 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 22 April 2003, 02:34

Hey Kevin...

What version of checkout_shipping.php are you using? Take a look at the top of the file and note the date that the file is labeled with. I went back and compared 4 different checkout_shipping.php files from 4 different snapshot dates... 12/20/02, 1/10/03, 2/11/03 and MS1.

It seems between 12/20/02 and 1/10/03, there were some changes made to the checkout_shipping file. If you would like to send me your checkout_shipping.php file, I will tell you where it needs to go.

eMail me the file... oscsupport@hostingandcolo.com

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#13 Snowman

  • Community Member
  • 645 posts
  • Real Name:Banned
  • Location:Coleraine, VIC, Australia

Posted 03 May 2003, 11:21

Ive just installed this mod on a MS1 release.

Great very handy mod :)

#14 kmcar

  • Community Member
  • 83 posts
  • Real Name:Kevin Carolan

Posted 03 May 2003, 13:20

Quote

Ive just installed this mod on a MS1 release.

Great very handy mod :)

It's great ... In the future I hope that they change it a little to make it per item instead of per order.

Kevin

#15 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 10 May 2003, 20:01

Having problems with this mod. I thought it all worked well but now it won't add my tax to the total order. I've worked for a week now trying to figure out why my tax does not add to the total. I uploaded my orignal classes/orders.php file and now it works. If I use the modified orders.php for giftwrap it won't add the tax to the total. So something is wrong with the classes/order.php file in giftwrap mod.

#16 ugottasalsa

  • Community Member
  • 730 posts
  • Real Name:Randy Newman
  • Location:Venice Beach, Ca.

Posted 10 May 2003, 21:44

First off... is GiftWrap showing up on the checkout_confirmation AND its not adding the TAX?

At the end of the /classes/order.php file, this is the bit of code that handles the calculation of subtotal, shipping, (giftwrap), tax and total...

****** ORIGINAL CODE ******

      if (DISPLAY_PRICE_WITH_TAX == true) {

        $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];

      } else {

        $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];

      }

    }

  }

?>

****** END ORIGINAL CODE ******
This is the replacement code for the GiftWrap Module...
******* REPLACEMENT CODE FOR GIFTWRAP ******

      if (DISPLAY_PRICE_WITH_TAX == true) {

        $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'] + $this->info['giftwrap_cost'];

      } else {

        $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'] + $this->info['giftwrap_cost'];

      }

    }

  }

?>

****** END REPLACEMENT CODE FOR GIFTWRAP ******
My guess is that your issue has something to do with this section of code.

If you continue to have issues, please let me know.

-R
"Courage is not the absence of fear, but the awareness of fear and the ability to get past it."

It's difficult to diagnose an issue when the patient says, "I have this pain right here Doc, what do you think it is?"

#17 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 10 May 2003, 22:03

I thought so too but that wasn't the case. I have no ideas.
I checked the code 5 times in giftwrap and I have it just as it says. But it's still not adding the tax in the total.

It shows the correct tax that should be added but does not add it to the total. It DOES add the tax on the shipping charges, however.

#18 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 10 May 2003, 22:05

Here's an example:

Sub-Total: $5.00
USPS Table Rate (Ships in 7-10 business days): $2.00
(No Gift Wrap): $0.00
Ohio TAX 5.75%: $0.41
Total: $7.12


It adds the 12 cents tax for the shipping but is not adding the other 29 cents for the product tax

#19 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 10 May 2003, 22:06

when I take out the orders.php that was modified for giftwrap and use the original everything works properly.

#20 baresinsations

  • Community Member
  • 361 posts
  • Real Name:Marie
  • Location:Ohio, USA

Posted 10 May 2003, 22:08

grrr..wish we had an edit on here. Also Tax in Price is set to false. IF I change this to true, it will work with the modified giftwrap orders.php but I do not want the price with tax to show. It is confusing for the customer and looks as if the prices are higher.