Author Topic: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod  (Read 456094 times)

JJRO

  • Jr. Member
  • **
  • Posts: 62
Thanks for the reply - I am doing a complete reinstall and will see how it goes.

I appreciate your work here - and I see that this will be part of the next release (as it should be!!).
And yes, YOU are the only one who seems to working on this. So thanks...

Quote
If you use one add to cart button per product, then this changes to add to cart because you are selectively adding to the cart and each press will update the cart by one extra product.
For some reason my install removed all single add to cart buttons - again, most likely something I did.
I'll start from scratch.

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #361 on: February 12, 2007, 09:32:24 am »
Mark,
I hope you don't mind.  I have modified your latest version (1.09) so that my clients could sort their listing by specific columns.  I have attached the modified files and a snapshot showing where they select the columns to sort by.


[attachment cleanup by admin]

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #362 on: February 12, 2007, 14:20:26 pm »
Mark,
I hope you don't mind.  I have modified your latest version (1.09) so that my clients could sort their listing by specific columns.  I have attached the modified files and a snapshot showing where they select the columns to sort by.


Hi Thomas,

looks good, but the product DB table has been modified. I would include the sql script to update the db table and provide instructions on how to apply it.

I'm happy for anybody to improve or add functionality to the mod. I purposely wrote it with no DB changes to make it easier to install.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #363 on: February 12, 2007, 16:25:59 pm »
Sorry.  I meant to include the SQL.
I really tried to find a way around making structural changes, but there was no way I could think of.  I do believe the code could be optimized and made more friendly but I didn't have time.  Really need to finish this current project.  Your work has helped tremendously!

Here is the SQL:
Code: [Select]
--
-- Child List Mod Structure Changes
--
ALTER TABLE `jos_vm_product` ADD `first_order` VARCHAR( 4 ) default 'empt',
ADD `second_order` VARCHAR( 4 ) default 'empt',
ADD `third_order` VARCHAR( 4 ) default 'empt',
ADD `fourth_order` VARCHAR( 4 ) default 'empt'

silexian

  • Beginner
  • *
  • Posts: 9
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #364 on: February 12, 2007, 16:30:50 pm »
Hi Macallf,

there is a little bug with Internet Explorer 6 while using the dropdown to select a child product, when you use the Joomla included SEF option.

The function list_attribute_drop  from the file ps_product_attribute.php. Note the "/" before "index.php?"..
Because you get longer and longer and longer URLs each time you use the dropdown.

Replace

Code: [Select]
$html .= "<select class=\"inputbox\" onchange=\"var id = document.getElementById('addtocart').prod_id[selectedIndex].value; if(id != '') {window.location='index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id } ;\" id=\"product_id_field\" name=\"prod_id\">\n";
by

Code: [Select]
$html .= "<select class=\"inputbox\" onchange=\"var id = document.getElementById('addtocart').prod_id[selectedIndex].value; if(id != '') {window.location='/index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id } ;\" id=\"product_id_field\" name=\"prod_id\">\n";
Question : Could we create a SEF friendly URL for that dropdown list ?
Probably with a javascript function where we would switch to an URL in fonction of the option value...


ps : Great MOD Macalff ... even if I took long hours to well understand the child product thing...

Regards,
Silexian

silexian

  • Beginner
  • *
  • Posts: 9
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #365 on: February 13, 2007, 11:49:33 am »
Hello,

I have 2 problems with Child lists :

1/ price depending of the quantity, no matter what child product I buy :

If the parent has defined the price in fonction of the quantity, and if the childs do not have the price set, i would like to have a global price management.
-> If the parent has Price #1 for 1 product, Price #2 for 2 products,
and if i buy 1 product of Child #1 and 1 product of Child #2,
why don't I have the Price #2 for the product ?

ex: I want to sell shoes, and I have Child Products as "Size 42", "Size 43" and so on... I've defined child products because of the stock (each child has a different stock based on the size).
So ... How coul I would like to buy "Size 42" and "Size 43" and have the Price #2 (discount) ?

2/ I don't want to have an "Add to Cart" on the parent product if it has child products.

How could I do that ?
I there is a product without Child, ok, it needs an "Add to cart" button.
If there are child product, I shouldn't have that button.

Ex: I have shoes, I cannot buy a product if I have not selected the size.

Solution for 2/ : (LINK)Prevent Customers from Additing Parent Product to Cart

Thank you,
Silexian

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #366 on: February 13, 2007, 14:38:49 pm »
Hi Silexian,

1. Do the children have the same parent? If they do then multiple child discounts should work, if they are from different parents then they won't.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

silexian

  • Beginner
  • *
  • Posts: 9
Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
« Reply #367 on: February 13, 2007, 14:55:04 pm »
Hello Macallf,

the children have the same parent.

Notice that i didn't set the price to the children.
I just set the price on the parent ("Add a price" for each quantity).

I didn't test with the discount settings yet.

Silexian

JJRO

  • Jr. Member
  • **
  • Posts: 62
Just a short note - I reinstalled and this module ROCKS!!!!!!!!!!!!
It is exactly what my client was looking for. Nice work.
And my apologies for not installing this thing correctly the first time.

mike420

  • Beginner
  • *
  • Posts: 23
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #369 on: February 14, 2007, 13:41:08 pm »
Hi macallf,

This mod is exactly what I was looking for :) Thank you for sharing it.

The only problem I have is that when a customer selects a manufacturer from the drop down list (mod_virtuemart_manufacturers), all items are displayed with an  add to cart button each.

This also happens if a customer does a search.

Is there any way to get it to display just one add to cart like the browse pages?

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #370 on: February 14, 2007, 13:57:18 pm »
Hi macallf,

This mod is exactly what I was looking for :) Thank you for sharing it.

The only problem I have is that when a customer selects a manufacturer from the drop down list (mod_virtuemart_manufacturers), all items are displayed with an  add to cart button each.

This also happens if a customer does a search.

Is there any way to get it to display just one add to cart like the browse pages?

This mod only works with parent-child relationships. i.e. if you select a parent with children then each child is an individual product. When you do a search or the manufacturers list, then these are individual products not child products of a parent!

That is why it is not working the way you expect. This mod is designed just for child products, not all products.

However, there is an option to allow the browse pages just to have one addtocart button. If you look at this thread http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg37613#msg37613

You should see what I mean, this should be possible to be expanded to the search and manufacturers list, but I haven't looked at that.

I hope this helps

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

mike420

  • Beginner
  • *
  • Posts: 23
Thanks for your reply Macallf.

I think I understand what you are saying, but unfortunately I am VERY new to PHP!

I have bought a couple of books on PHP and also downloaded quite a few tutorials as PHP is something that I would really like to learn.

I have managed to 'Hack' virtuemart in many places to get the functionality that I require, but I think this is beyond me, (or maybe it is'nt, I just don't now how to do it yet!!).

If there is anybody out there who could give me a few pointers in the right direction on getting this to work I would greatly appreciate it.

Andy

  • Beginner
  • *
  • Posts: 5
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #372 on: February 14, 2007, 20:43:25 pm »
I'm using  virgin Joomla-1.0.12_eCommerceEdition_VM-1.0.9

 administrator/index2.php?page=admin.show_cfg&option=com_virtuemart

It complains at the start after installing ChilList109-1 about an undefined variable that can be fixed by  checking the new box "Dont show cart on add to cart" on and off in Configuration, i.e.


I still get multiple messages (1 per item?) about an undefined index at the front end, .i.e.

index.php?page=shop.product_details&flypage=shop.flypage&product_id=27&category_id=5&manufacturer_id=0&option=com_virtuemart&Itemid=26

Notice: Undefined index: product_parent_id in administrator/components/com_virtuemart/classes/ps_product.php on line 1712


macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #373 on: February 14, 2007, 22:53:26 pm »
I'm using  virgin Joomla-1.0.12_eCommerceEdition_VM-1.0.9

 administrator/index2.php?page=admin.show_cfg&option=com_virtuemart

It complains at the start after installing ChilList109-1 about an undefined variable that can be fixed by  checking the new box "Dont show cart on add to cart" on and off in Configuration, i.e.


I still get multiple messages (1 per item?) about an undefined index at the front end, .i.e.

index.php?page=shop.product_details&flypage=shop.flypage&product_id=27&category_id=5&manufacturer_id=0&option=com_virtuemart&Itemid=26

Notice: Undefined index: product_parent_id in administrator/components/com_virtuemart/classes/ps_product.php on line 1712



The first point, check the box save the configuration. Uncheck the box and save again. This just sets the variable up and will never be shown again as an error. This just allows for a global parameter to be set for displaying the cart page on add to cart or not.

The second point, this normally happens if you do the update with items already in the cart. Delete everything from the cart and try again. If this doesn't fix it and you have a link to a live site, please post so that I can check it out.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

Andy

  • Beginner
  • *
  • Posts: 5
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #374 on: February 15, 2007, 19:26:57 pm »
 Sorry for the terse nature of my last post. I was in a panic when I realised how much change was needed to make vm work for my app, and at the time your offering looked like a possible rather than a probable. But I'm delighted to say you look like saving my bacon. Very good! Many thanks. And you responded to my post faster than a paid helpdesk!