Jump to content
zonetown

[Contribution] QTpro - Quantity Tracking Professional

Recommended Posts

Florence,

 

* do you have same problems before you installed QT Pro?

* do you install another contribution at the same time with QT Pro?

Share this post


Link to post
Share on other sites

Florence,

 

* do you have same problems before you installed QT Pro?

* do you install another contribution at the same time with QT Pro?

 

Hi Rus ! thanks for replying :) Unfortunately I cannot answer your first question for sure as I installed QT Pro before looking into the shipping issue. However, I have in my server a "virgin"version of OS Commerce, which I use to check what would be the usual behaviour of OS Commerce in case things go wrong, and this one does not have QT Pro on, and this virgin version works fine.

As for the rest I have Easypopulate and Multiple Image with Fancy Box.

 

My shop still doesnt want to calculate shipping costs according to the weight so I decided to charge per price (I sell kids clothes, so the weight is not so much an issue).

 

In the meantime I want to install Product Quantity Drop Down add on, and there QT Pro complicates my life . Here is what I am supposed to do in the includes/application_top file :

 

"Open includes/application_top.php

 

Find: (374)

 

 // customer adds a product from the products page			
     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break; 

 

"Replace with:

 

  // customer adds a product from the products page
     case 'add_product' :    if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
			if (tep_has_product_attributes($_POST['products_id']) && PRODUCT_LIST_OPTIONS != 'true' && basename($PHP_SELF) != FILENAME_PRODUCT_INFO) tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id']));
			$add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1);
                               $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$add_quantity, $_POST['id']);
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

"

But here is the code that I have in my file and specifically QTPro code

 // customer adds a product from the products page
     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
//++++ QT Pro: Begin Changed code
                               $attributes=array();
                               if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
                                 $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
                                 foreach ($attrlist as $attr) {
                                   list($oid, $oval)=explode('-',$attr);
                                   if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
                                     $attributes[$oid]=$oval;
                                 }
                               }
                               if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
                                 foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
                                   if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
                                     $attributes=$attributes + $HTTP_POST_VARS['id'];
                                 }
                               }

                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);								
//++++ QT Pro: End Changed Code

                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

 

 

I have no idea how to accomodate the two pieces of code... can anyone help on this one ? Thanks !!!

Share this post


Link to post
Share on other sites

Spring holidays has delayed my reply. If you still need help lets see your code.

 

You have special contrib installed, that allows you to put into the cart items with quantity directly from product listing or product page itself. It doesn't matter. This line of code simply checks the quantity you want to put into the cart:

$add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1);

 

This line adds the quantity from previous line to your cart:

$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$add_quantity, $_POST['id']);

 

So, if you want to add this functionality to QT Pro you need to add the first line and slightly change the second. Here it should be:

// customer adds a product from the products page 
     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { 
//++++ QT Pro: Begin Changed code 
                               $attributes=array(); 
                               if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { 
                                 $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); 
                                 foreach ($attrlist as $attr) { 
                                   list($oid, $oval)=explode('-',$attr); 
                                   if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) 
                                     $attributes[$oid]=$oval; 
                                 } 
                               } 
                               if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { 
                                 foreach ($HTTP_POST_VARS['id'] as $key=>$val) { 
                                   if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) 
                                     $attributes=$attributes + $HTTP_POST_VARS['id']; 
                                 } 
                               } 

                               $add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1);
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+$add_quantity, $attributes);                                                                 
//++++ QT Pro: End Changed Code 

                             } 
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); 
                             break;

 

Try to do and carefully test. I don't do test, simply looking the code.

But you must avoid to do this if you use module of QT Pro which cheks available quantity of items in stock. The reason is that QT Pro checks only one item, but you may add more. Of course it is not a problem, because in the cart your customer will see insufficient stock. But it is a good idea to modify QT Pro plugin such, that it may take into account customer's wishing adding more than one quantity at a time and brings up an appropriate dialog.

 

 

 

And there is one last line I tell about:

if (tep_has_product_attributes($_POST['products_id']) && PRODUCT_LIST_OPTIONS != 'true' && basename($PHP_SELF) != FILENAME_PRODUCT_INFO) tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id']));

This code checks if product has attributes, should it be redirected from product listing to product page or not. Do you need this in your installation I don't know, because I don't test.

Share this post


Link to post
Share on other sites

First of all, many thanks for taking the trouble to look into my code, I really appreciate it :)

I have upheld the quantity box feature so far, wanting to be sure of the code, so I am still in need of help ;)

 

 

But you must avoid to do this if you use module of QT Pro which cheks available quantity of items in stock. The reason is that QT Pro checks only one item, but you may add more. Of course it is not a problem, because in the cart your customer will see insufficient stock. But it is a good idea to modify QT Pro plugin such, that it may take into account customer's wishing adding more than one quantity at a time and brings up an appropriate dialog.

 

That's exactly what I have got : a table letting the customer know how many pieces there are left in the stock depending on size and color... so if I understand you well your suggestion will not fit. In any case, it made me think : in my business (kids clothes) it's unlikely a customer will want two pieces of the same size and same color (it can happen, but not very often). To purchase different models of the same item would require me to add to the page the possibility of selecting color/size several times, and that's just going to be a mess. Customers will have to go back to the product listing, and do the selection again with different attributes, and that's all...

 

I wonder if I should note that on the screen though...

 

In any case THANKS again for your help : I found a solution through your comments and that's really good :)

 

 

Flo

Share this post


Link to post
Share on other sites

Peter, or anyone else who may be able to assist, thanks to help from Peter I have QT Pro working with AJAX attribute manager. I am managing the quantities via AJAX Attribute Manager but would like to have quantity management capability in QT Pro also.

 

There are a couple parts of QT Pro not working for quantity updating but the one I want to focus on fixing for now is in admin->reports->stock report. When I click on a product it takes me to "http://www.myshop.com//adminfoldername/stock.php?product_id=409" for example.

 

QT Pro Doctor says all is OK. But the part of the page where you can update quantites by attribute won't work. I can select an attribute from the drop down, enter the quantity, but when I click ADD I get an error page. Apparently what is happening is the web store address is not being picked up because the URL only shows: "http://adminfoldername/stock.php?option2=1&quantity=2&product_id=409&action=Add"

 

Any ideas?


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Hi everyone,

 

Hope somebody can help with this problem - thought it would be easy to do but I'm struggling....

 

I have qtpro installed on my website and when an attribute is out of stock we have an "Out of Stock" message displayed on the webpage alongside the attribute size. Check out the link below for an example.

 

Example Link

 

The code that does this came with the default install and I've located it to the catalog/includes/classes/pad_base.php file. What I would like is to have the other displayed attributes on a product page which are in stock to have a "In Stock" message alongside them similar to the out of stock one.

 

E.g.

 

Small - In Stock

Medium - Out of Stock

Large - In Stock

 

I'd really appreciate it if anyone can help me out and tell me if this is possible to do and how to go about it. Thanks very much!

Share this post


Link to post
Share on other sites

Hi all :)

 

when i add for example sizes from 3-5

 

and then add sizes from 1-3

 

And then make a produkt with sizes from 1-5 i get the wrong order in sizes since i didnt put 1-3 before i added the 3-5 options..

 

Can i change this so that the order of the options always start with the smallest size first and then larger?

 

I really hope you understand what i mean :blush:

Share this post


Link to post
Share on other sites

Hi all :)

 

when i add for example sizes from 3-5

 

and then add sizes from 1-3

 

And then make a produkt with sizes from 1-5 i get the wrong order in sizes since i didnt put 1-3 before i added the 3-5 options..

 

Can i change this so that the order of the options always start with the smallest size first and then larger? Chnge the sort order of the different sizes?

 

I really hope you understand what i mean :blush:

Share this post


Link to post
Share on other sites

Hi Solan,

 

The AJAX Attribute Manager add-on solved that one for me. You can use that to move the sizes around into the order you want.

 

Cheers,

 

Ed

Share this post


Link to post
Share on other sites

Hi everyone,

 

Hope somebody can help with this problem - thought it would be easy to do but I'm struggling....

 

I have qtpro installed on my website and when an attribute is out of stock we have an "Out of Stock" message displayed on the webpage alongside the attribute size. Check out the link below for an example.

 

Example Link

 

The code that does this came with the default install and I've located it to the catalog/includes/classes/pad_base.php file. What I would like is to have the other displayed attributes on a product page which are in stock to have a "In Stock" message alongside them similar to the out of stock one.

 

E.g.

 

Small - In Stock

Medium - Out of Stock

Large - In Stock

 

I'd really appreciate it if anyone can help me out and tell me if this is possible to do and how to go about it. Thanks very much!

 

Can anyone help me with the above problem please? I'm pulling my hair out with this one :(

Share this post


Link to post
Share on other sites

This contribution is a great idea but in product_info the table with the attribues ist not in a sort order like

 

small

medium

laarge

 

in my shop it looks

medium

large small

 

also I search for a sort order.

 

can somehome help?

Share this post


Link to post
Share on other sites

This contribution is a great idea but in product_info the table with the attribues ist not in a sort order like

 

small

medium

laarge

 

in my shop it looks

medium

large small

 

also I search for a sort order.

 

can somehome help?

 

As i posted above, use the AJAX Attribute manager contrib - that allows you to adjust the order.

 

cheers,

 

Ed

Share this post


Link to post
Share on other sites

I have been trying for weeks to fix the issue of QT Pro and the more recent versions of paypal IPN working together. Im just not a good enough coder to work it out.

 

Well someone has fixed it, if you look here - http://addons.oscommerce.com/info/2679 you can find the replacement files for paypal to make it QT Pro aware. The author of this work is Gaaalmp - you are a legend!!!

 

Thanks for fixing this! Very much appreciated.

Share this post


Link to post
Share on other sites

Hello all.

 

I have failed to see anyone having a problem with showing the OUT OF STOCK message to my extent.

 

I have a few contribs installed and they work like a charm. I installed QT Pro to keep track of different sizes

but have run into an issue. When I enter on size to lets say size 5.5 qty 0 all works fine and shows the OUT OF STOCK.

However, soon as I install another size, lets say size 6 Qty 2, the OUT OF STOCK disappears on size 5 and allows customer

to checkout for purchase on the size 5 that has no stock.

 

I also noticed that in QT Pro, it does not deduct the qty of the size after purchase but shows message in QT Doctor.

 

 

 

This is a huge problem of course.

 

I am running OC RC2a with the following mods;

PWA - QT Pro w/the sort option - Easy Populate - Paypal Express - UPS & USPS Shipping

Edited by beanzy

Share this post


Link to post
Share on other sites

Problem solved with QT Pro and Product Attributes Sort Order

 

In catalog/includes/classes/pad_base.php

Find this:

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$this->products_id . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

REPLACE with this:

// BOE: Attribute Sort with Clone Tool

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$this->products_id . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.options_values_price, pa.Products_attributes_id");

// EOE: Attribute Sort with Clone Tool

Edited by mikeyswede

Share this post


Link to post
Share on other sites

Re-Installed QTPro and is working good now. I want to re-install PWA - Purchase Without Account

and have one line of data that I need help on merging the checkout_process.php. Please see below;

 

 

PWA - Need to install

 

if(is_array($rp_profile_id_arr) and array_key_exists(tep_get_prid($order->products[$i]['id']), $rp_profile_id_arr)){

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty'],

 

 

 

QTPro - Installed already

 

if (!isset($products_stock_attributes)) $products_stock_attributes=null;

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty'],

 

As you can see, it is only the first line of code between the two that I don't

know how to merge as they are different.

 

Can someone give suggestion please...Thanks

Edited by beanzy

Share this post


Link to post
Share on other sites

hi i installed the qtpro for my website.

 

when customers buy product using credit card (world pay) it brings the customer to success page(back to website). but it does not subtract quantity of product. (warning of sick product in database)

 

but when i try to purchase with shipping method ...cash on delivery it subtract quantity and works fine.

 

what is wrong ...please help. :(

 

 

thanks

Share this post


Link to post
Share on other sites

hi i installed the qtpro for my website.

 

when customers buy product using credit card (world pay) it brings the customer to success page(back to website). but it does not subtract quantity of product. (warning of sick product in database)

 

but when i try to purchase with shipping method ...cash on delivery it subtract quantity and works fine.

 

what is wrong ...please help. :(

 

 

thanks

 

 

I have the same issue only with paypal. I dont know what the issue is. It works ok when the customer makes an order with their credit card! I have been wrecking my brains to work out what is wrong! Any ideas people?

Share this post


Link to post
Share on other sites

I have the same issue only with paypal. I dont know what the issue is. It works ok when the customer makes an order with their credit card! I have been wrecking my brains to work out what is wrong! Any ideas people?

 

See my post above on this page - its been fixed. I spent months trying to fix it, but luckily someone else did!

Share this post


Link to post
Share on other sites

Hi,

 

I am hoping someone will help me out.

The QTpro contribution I think uses alert() javascript function to display a message on the screen for example:

When a product has an attribute that is Out of stock and you set "Preventing Adding out of stock to cart" to "true" in the admin panel. A message in red should be displayed underneath the drop-down list on the product page saying "The combination of options you have selected is currently out of stock. Please select another combination".

It seems that this message is only shown in IE6 browser. All newer browsers are blocking the javascript alert function.

 

Has anyone seen the same thing happen?

What happens on your systems?

 

Can someone shed some light or answers to what they believe is the problem or a way around it?

 

Thanks

George

Share this post


Link to post
Share on other sites

Hi,

Its OK I found out the issue. It was a syntax error I created whilst trying to get all the javascript functions in class files pad_xyz.php html validated.

If you haven't touched any of these files the function should work out of the box, but it wont validate at W3C. No big deal.

Share this post


Link to post
Share on other sites

OK guys here is one for ya! I have qtpro installed will attribute sets. How do I get use different prices with say two sets on the same product eg

 

colour set: red

green

blue

 

 

size set: small

medium

large

 

lets say red->small costs £25

 

but blue->small costs £35

 

 

How can i do this?

 

 

Dee

Share this post


Link to post
Share on other sites

How can i do this?

Dee

Surely this is just a maths thing right.

If default product price is 20.

Red is 5 extra when adding the attribute

Blue is 15 extra...

 

I assume med, large etc will also get a different price.

 

Your just asking "how do I add x for different colour tops"

 

create product option.

create option values.

when you add the product attributes, append the value price to it.

Share this post


Link to post
Share on other sites

Hi all, anyone who having this problem and solved between contribution qp_autoinstaller_2.14_4 and separate_price_422?

Appreciate if you can share with me.

 

The dropdown price is fine when a retail customer view my product_info page, but when wholesaler view it the dropdown price still shows the retail price. Only when they add items to the shopping cart and the wholeprice shows in shopping_cart.php

 

untitled.JPG

 

Hope you can share with me how to fix this.

 

Thanks

 

Ariff

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

×