Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Get 1 Free


kymation

Recommended Posts

LOL , a nice way to says "DO NOT ADD ANYTHING AT ALL" - it does make the code more explicit and easier to read :D

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hi Jim, thanks for the reply.

you are correct, just removing the whole block has the same result - fixes my error the same. Thank you.

 

I was thinking that changing item quantity to 0 would be needed further down the code in the free item "item x weight" math result part, but I was not reading it correctly. I see now.

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

@@Roaddoctor

 

Hi Dave

 

Regarding this whole Shipping Quotes and Get 1 Free.

In my shop i have free shipping after a certain amount (stock osC function) for the Get Free item I do charge shipping. So if you buy item A and get item B for free shipping for A+B will be calculated and charged.

Therefore I don't have any problems with this whole Get 1 Free and Shipping Quotes.

I can imagine though people that use SSPP (Separate Shipping per Product) or other similar add-ons might get wrong results when using Shipping Quotes in cart.

But I am glad that you could find a solution to fit your needs. :thumbsup:

 

Still haven't figured out the date expire issue yet though...just no time at the moment to look deeper into it. :wacko:

Edited by Tsimi
Link to comment
Share on other sites

OK I unwound above - probably not proper way to sort this.

 

I have Free Shipping per Product, Get-One-Free, Shipping Quote in Cart 2.3.3.4

 

All is fine except for when BOTH the Purchased Item and Get-One-Free item has "Ship this item Free" selected.

 

When that combination is present, the Ship Quote in Cart displays the FedEx quote Generic error rather than the "Free shipping for all of your cart products" message.

 

not a critical error, but enough to dissuade a buyer I think.

 

If anyone has any insight on how to properly correct that I would greatly appreciative.

 

 

-Dave

Link to comment
Share on other sites

  • 5 months later...

@@Tsimi @@kymation or anyone who may know the answer...

 

When I go to use order editor (ajax enabled), if the order has a get one free item and I make a change to the order, such as products or shipping etc..., the SUB TOTAL recalculates incorrectly. The recalculation is including the value of the free item instead of $0.00.

 

Where in the code is the sub-total recalculated? and any chance you know what change needs to be made?

 

Thank in advance.

 

Dave

-Dave

Link to comment
Share on other sites

Free items are mostly handled in the cart class. I don't know if the order editor uses that class. Apparently not or this wouldn't happen. Sorry, I'm busy with a major site move right now and can't look at this further.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

to be more specific - it is only the Subtotal field that is ignoring the free aspect of the free item. The final total still calculates right.  After looking at it more last night I suspect it's an AJAX issue ??? I know nothing about AJAX though..

-Dave

Link to comment
Share on other sites

@@Roaddoctor

 

Hi Dave

 

I did some testing in my local shop and there are several issues with that order editor addon but none of them are affecting the Get1Free addon.

I tested both types of order editor with AJAX and without it. The results below are after switching things around like adding or removing products or change shipping method.

Test Order 1: (International Customer)

 

Product A - $16.25

Free Product - $0.00

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

Subtotal: $16.25

Shipping Method A: $10.40

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

Total: $26.65

 

Test Order 2: (Domestic Customer)

 

Product A - $16.25

Free Product - $0.00

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

Shipping Method: $5.50

COD: $4.00

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

Total: $25.75

 

Sometimes it doesn't calculate the COD fee or you can't add a new field after the subtotal in AJAX mode. There are several issues either functional or calculating-wise but no issues with the Subtotal when Get1Free item is included. At least I cannot replicate that error. Order Editor used was this one (http://addons.oscommerce.com/info/7844) saiSoftIndia Version from 8 Aug 2011.

Edited by Tsimi
Link to comment
Share on other sites

  • 4 weeks later...

Hi tsimi,
I have installed get 1 free on oscommerce bootstrap master.
Now I have to do an adjustment in shoppingcart.php on line 102.


$products_name .= '<br>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'style="width: 45px;"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_hidden_field('free[]', $products[$i]['free']) . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-refresh', NULL, NULL, NULL, 'btn-info btn-xs') . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-remove', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product'), NULL, NULL, 'btn-danger btn-xs');​

 

it comes to glyphicon. it is removed in master ????

should it be adjusted or not ???? because it works properly​ I think.

Link to comment
Share on other sites

Yes, if you're using the latest version of osC Bootstrap Edge, the glyphicons have been replaced with Font Awesome icons. Replace with whatever looks good to you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 5 months later...

In the free product? Yes, with a workaround.

In the products to get credit towards a free product? No.

 

If you meant somethig else, please explain.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation,

 

Hi Jim,

I mean when you sell lingerie. You have an bra in the categorie/products. Now you have an short you put in in the product attribute.

The bra will cost €???, (The short will cost €??? Only In combination with the bra).

So you can not buy the short without buying the bra. (Because the short is not in the categorie/products itself)

Now my question is when you put the bra in (get 1 free) I want to put in the short as the one you get free.

 

I hope I explained it well.

Link to comment
Share on other sites

Put in the shorts as a regular product. Put that in a hidden category if you don't want to well it separately. Then set up the shorts as the free product for the bra.

 

You could also just put the shorts and bra as one product, and state in the description that they come as a set, or the shorts are free with the bra.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Then you can't do it this way. Set the colors/sizes as options and sell the products together.

 

There is a Master Products addon that allows you to build a product by selecting parts. I don't know if that would work here, or if it's even up to date. Might be worth checking out though.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 9 months later...

I have installed the newest version of the Bootstrap Edge and have applied the Modular Products Page addon. Is there a fairly easy way to incorporate the code change to the product_info.php file for the Get 1 Free addon? Would this be it's own module or would it be added to an existing module? Any help that you can give would be greatly aapreciated.

Link to comment
Share on other sites

I would make it a separate module so that I could move it wherever I wanted it. You could add it to another module if you know that you want it to show right under/over that module's output.

 

You will probably need to make other changes to the code, since the Modular Product Page  gets its data from a product class. I'll try to help if you get stuck, but I don't have the time right now to code the whole thing for you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 10 months later...

@Tsimi

Hey Lambros,

I installed this addon and just wanted to let you know that the latest release has instructions that do not fit the BS Edge install. For one thing, there are no file name definitions, or a files for /admin/includes/filesnames.php or /includes/filenames.php And, there are code changes like what Will (dinopacha) mentioned above for shopping_cart.php, ..plus other instructions.

That's not a big deal for me, because I can work my way around code, but it would be a for a non-technical user.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@Demitry

Yeah, I know it is not up to date.
I should have a look at it once and see what needs to be done to have it completely Edge compatible.

22 minutes ago, Demitry said:

And, there are code changes like what Will (dinopacha) mentioned above for shopping_cart.php,

Which post exactly?

Link to comment
Share on other sites

this one from Sept 20th, 2015:
 

Hi tsimi,

I have installed get 1 free on oscommerce bootstrap master.
Now I have to do an adjustment in shoppingcart.php on line 102.


$products_name .= '<br>' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'style="width: 45px;"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_hidden_field('free[]', $products[$i]['free']) . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-refresh', NULL, NULL, NULL, 'btn-info btn-xs') . ' ' . tep_draw_button(NULL, 'glyphicon glyphicon-remove', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product'), NULL, NULL, 'btn-danger btn-xs');


it comes to glyphicon. it is removed in master ????

should it be adjusted or not ???? because it works properly I think.

and there are also instructions for $HTTP_POST_VARS and $HTTP_GET_VARS, which don't exist in BS Edge. And another line that was re-coded for BS Edge, which does not match the instructions. I cannot remember what file it's in at the moment.

Like I said, not a big deal, but would be for someone less technical.

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

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...