Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Porting 2.2 addon - Minimum Product Quantity - to 2.3


25 replies to this topic

#1 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 28 January 2012, 15:14

I started using osC with 2.3.1 and require the usage of this addon, Minimum Product Quantity with Admin, made for osC 2.2. Downloading the addons gives only a text file with the codes and instructions to add to osC - I've made it available on Pastebin.com.

I would like some help to port this to osC 2.3.

#2 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 28 January 2012, 17:56

I'm reposting this in Addon Development subforum, I kindly request the mods to delete this thread.

#3 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 06 February 2012, 20:30

I've been trying to use this addon as is, and have been quite successful adding it's components into osC 2.3 thus far (except the admin parts, which I don't really need).

However, I'm confused about steps 16 and 17 (please take a look at the installation instructions I uploaded to PasteBin). It says something about modifying product_listing.php which is nonexistent on osC 2.3. What is it's equivalent file on 2.3? Do I even need to add those lines now?

#4 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 06 February 2012, 22:46

product_listing.php is located in catalog/includes/modules/product_listing.php it is very much real :)

#5 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 06:46

Ah! Thank you! I was editing files in catalog, and assumed this file to be there without even reading properly... Stupid carelessness...

#6 14steve14

  • Community Member
  • 2,176 posts
  • Real Name:Steve
  • Gender:Male

Posted 07 February 2012, 08:25

In general the admin part of the addons for 2.2 will need very littlew re coding, its only really the store area that has been modded. Just follow the instructions for a manual install , and do not use any drop on top files.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder. OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.

#7 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 09:01

View Post14steve14, on 07 February 2012, 08:25, said:

In general the admin part of the addons for 2.2 will need very littlew re coding, its only really the store area that has been modded. Just follow the instructions for a manual install , and do not use any drop on top files.

I don't need the admin part (I can just table as CSV and reimport on phpMyAdmin, which is way quicker). But if I want to re-release the addon as compatible with 2.3 (with minor changes to some of the instructions), I would need to verify the Admin area works as well. Can you help me?

Anyway, other than the first step the others were quite straightforward since I found the relevant lines where I needed to at MPQ code. But now the shopping cart is spewing out errors at the bottom:

Quote

Fatal error: Call to a member function checkout_initialization_method() on a non-object in/home/oxwivix1/public_html/shopping_cart.php on line 169

Any idea what I can do about this? I don't have any solid reason, but I'm guessing the auto update the quantity to the minimum amount is somehow conflicting with the auto price updater. When a product is added, the quantity shown is one, but at the bottom (above the error message) it says the quantity has been updated to the minimum specified. Only after refreshing or returning to the shopping cart displays the quantity updated by MPQ addon (the message disappears, but the error remain).

Edited by oxwivi, 07 February 2012, 09:02.


#8 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 09:22

This be my PasteBinned shopping_cart.php.

#9 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 16:57

Figured out the problem. I had pasted this:

//Minimum quantity code
    if ($cart_notice) {
?>
	  <tr>
	    <td class="stockWarning" align="center"><br><?php echo $cart_notice; ?></td>
	  </tr>
<?php
	  }
//End Minimum quantity code

It didn't play well with osC 2.3 stockWarning format, my mistake for not noticing it:

    <p class="stockWarning" align="center"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></p>
    <p class="stockWarning" align="center"><?php echo $cart_notice; ?></p>


#10 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 17:00

The only gripe I have with it now is that the numbers aren't automatically updated in the quantity boxes even as the warning is shown about updating the quantity to the minimum value. Please help me with this. Maybe I should make a separate thread.

#11 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 07 February 2012, 19:04

I muscled through this one awhile ago, but I noticed that you must go to your admin panel configuration/my store/Display Cart After Adding Product to True
This forces the cart to update the quanity for them, if you leave it off, they can continue to checkout without the minimum in their cart.

Hope that helps.

#12 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 07 February 2012, 19:20

That's the default option. When a product is added it goes to the cart, shows the warning, but that's it. The quantity box still shows one, and I'm afraid it may confuse the customers.

#13 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 07 February 2012, 22:09

If you mean the shopping cart still shows the orginal quanity I'm with you there, that has been a problem since back in 2.2. As soon as you take any other action however it is updated.. correct?

Here is an image of me adding an item with a min amount of 25 to my cart...

The message is very clear that there is a minimum and we took extra precaution on the product page to highlight the minimum order if it was greater then 1 so there should be no surprises.

You'll see in the image below my shopping cart in the top nav bar shows 1 item, but the page shows that it has been updated to 25, as soon as you take any action the cart changes to the correct amount, I believe this is because the action of modifying the cart quantity is not processed on click, rather when cart is viewed.

Attached Files


Edited by NodsDorf, 07 February 2012, 22:10.


#14 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 08 February 2012, 09:03

On 2.3, doing any action does not update it either. For example, if I click on update, it causes the warning to appear again (because it's still below minimum), and keeps the number same.

Is it possible to make it process on adding to cart, rather than when the cart is viewed? I wonder if the function responsible for adding to cart can take care of the numbers added, which basically corresponds to the minimum order.

#15 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 08 February 2012, 13:50

Think you may have missed a bit of modifications then, the example image above is a 2.3.1 shop. The cart is updated on the cart page, but not in the header nav bar which I think is called first as its in include /header.php but moving away from there (ie.. refreshing / clicking checkout) will update that qty and value as well.

#16 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 08 February 2012, 14:18

Can't be - unless I'm missing some instructions. I've reinstalled my test osC 2.3.1 twice and installed the addon following the instructions (you can check in this Pastebinned page there's only two steps involving shopping_cart). Can you share the instructions you used to install MPQ?

Edited by oxwivi, 08 February 2012, 14:21.


#17 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 08 February 2012, 16:18

Those the instructions I used as well.

I only had to modify it slightly to account for quanity price breaks, but its the same. I honestly dont' think I can help any more without looking at it.

Good Luck,
Don

#18 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 08 February 2012, 16:38

My test osC is at oxwivi.x10.mx, You can see that it's working as I described there.

By the way, are you using the admin controls (didn't attempt to install it as I don't need it)? If yes, the whole thing can be more or less evaluated as working under 2.3.1. You can rerelease the addon as 2.3.1 compatible. I will help modifying the instructions.

Attached Files



#19 NodsDorf

  • Community Member
  • 1,233 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 08 February 2012, 20:05

Can you post your catalog/shopping_cart.php not your language definitions. I looked at your store and see what you mean about the input box not updating to the adjusted quantity. However when I clicked anything else my quantity was adjusted to the MOQ.

#20 oxwivi

  • Community Member
  • 224 posts
  • Real Name:Oxwivi Oxwil

Posted 09 February 2012, 07:06

Oops, sorry did not notice I was in the language folder.

By clicking anything, do you mean navigating away (i.e. clicking on the links)? If that's case, yes, it's more or less the same thing as refreshing when you return to the shopping cart. Otherwise, clicking randomly on non-interactive area (background, etc) doesn't yield any effect to the quantity box.

Attached Files