VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: macallf on February 23, 2006, 17:08:12 pm

Title: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: macallf on February 23, 2006, 17:08:12 pm
**UPDATE Please see this post for updated files

Now updated to work with VM 1.0.5
ChildList 1.0.5 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg42544)

Now updated to work with VM 1.0.6
ChildList 1.0.6 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg51111#msg51111)

Major update with system wide quantity box mod
ChildList 1.0.6 Update (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg52992#msg52992)

Updated to work with VM 1.0.7
ChildList 1.0.7 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg58961#msg58961)

Updated to work with VM 1.0.9
ChildList 1.0.9 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg67283#msg67283)

Updated to work with VM 1.0.10
ChilList 1.0.10 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg72295#msg72295)

Updated 1.0.10- fixes a problem with advanced attribute pricing
Chillist 1.0.10-1 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg73204#msg73204)

Please note- All further updates will be posted on my site

Updated for VM 1.0.11
Mark Callf Designs (http://design.markcallf.co.uk/VirtueMart-1.0.x/ChildLIst.html)



I have searched the forum on how to make child products display as a list instead of a dropdown list.
The image at the bottom of this diplays the outcome.

I couldn't find any info so I modified the code to allow this.


[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: Amina on March 13, 2006, 00:04:44 am
ARRRRRGGGGGHHHHH ???

Hi,

I have attempted to configure the coding that you have mentioned word for word and have corrupted the entire virtuemart component.  I can not afford to remove the component based on the work crried out. therefore please take a look at www.dermaology.com and go to the shopping section and if need be i can give you access to the actual ftp section if you want to guide me manually, please do not let me down
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 13, 2006, 00:51:21 am
Hi,

Can't see the problem because nothings being displayed.

Have you tried changing line 299 in administrator\components\com_virtuemart\html\shop.product_details.php

from .$ps_product_attribute->list_attribute_list($product_id) back to .$ps_product_attribute->list_attribute($product_id)

and change line 305 from if (USE_AS_CATALOGUE != '1' && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {

back to

if (USE_AS_CATALOGUE != '1' && $product_price != "" && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {

This should restore the original functionality of the drop down list.

You could attach the shop.product_details.php & ps_product_attribute.php and I could check the modification and test it on my site.

Hope this helps

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: Amina on March 13, 2006, 13:11:03 pm
http://www.dermaology.com/administrator/components/com_virtuemart/classes/ps_product_attribute.php (ftp://http://www.dermaology.com/administrator/components/com_virtuemart/classes/ps_product_attribute.php)

The problme orginated from here, but I havereverted back to the original format, but still getting this error message:

Parse error: syntax error, unexpected '/' in /home/.dennis/ischola1/dermaology.com/administrator/components/com_virtuemart/classes/ps_product_attribute.php on line 259

http://www.dermaology.com/administrator/components/com_virtuemart/html/shop.product_details.php (ftp://http://www.dermaology.com/administrator/components/com_virtuemart/html/shop.product_details.php)

I have made the modification from http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=9824.0
prior to using your modification.

But can all this have been resolved if I had downloaded the module you have attached with this thread?

Thanks for the trouble and let me know
Title: Re: MOD: Child list instead of drop down.
Post by: Amina on March 13, 2006, 13:42:15 pm
Sorry I did not attach the relevant file, I do not think you can access using the ftp file I have given a link for;

I am usure how to attach a file! sorry. maybe you want to drop me a line at amina@dermaology.com and I can attach the file via my email. 

thanks
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 13, 2006, 13:42:38 pm
Hi Amina,

Can you actually attach the offending file to your next next post. I can then check it our against my originals and test it.
If you can zip up this file ps_product_attribute.php and attache it or change the extension from php to txt and attach it.

I did not actually attach any file to the original message just a diff file that allows patching of files.

I Have just reedited a standard file and tested it and it works fine on my test site.

I Have attached this just unzip and overwrite the original.(PLEASE BACK IT UP FIRST).

Hope this helps

Mark





[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: Amina on March 14, 2006, 00:39:00 am
Hi Mark,

I think it is sorted :o

I reloaded virtuemart, did not apply the 'stay on the same pag instead of going to cart' hack and just implemented your hack and it all looks good......

Your a good man

Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 14, 2006, 02:40:47 am
Hi Amina,

The problem lies with the show no cart mod, which assumes you are using php5.

The code for php5 is
Code: [Select]
if(stripos($_SERVER['HTTP_REFERER'],'category_id') ||
   stripos($_SERVER['HTTP_REFERER'],'product_id') ||
      stripos($_SERVER['HTTP_REFERER'],'shop.browse') )
      //if has category_id, then add to session or overwrite old referer variable
      {
           $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      }

To make this more universal replace the above code with.

Code: [Select]
if(strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('category_id')) ||
   strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('product_id')) ||
      strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('shop.browse')) )
      //if has category_id, then add to session or overwrite old referer variable
      {
           $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      }

This code works with earlier versions of PHP.

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 15, 2006, 20:55:10 pm
I have been working on a modification to my mod.

I noticed everytime you clicked on an 'add to cart' link that the page went to that childs details page.

This mod/hack keeps the product on the parents detail page. Benefits of this are


So if you are using multiple child items and the descriptions do not change, your shop will be easier to setup and maintain.

classes/ps_cart.php has to be modified.

Every occurence of $d['product_id] has to be changed to $d['prod_id'] There are several of these in the file so just search for every occurence and replace.

In classes/ps_product.attributes.php

change
Code: [Select]
$html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$db->f("product_id") ."\"><td>";

about line 246 to
Code: [Select]
$html .= "<input type=\"hidden\" name=\"prod_id\" value=\"".$db->f("product_id") ."\"><td>";
$html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$parent_id."\"><td>";

and change
Code: [Select]
$html = "<input type=\"hidden\" name=\"product_id\" value=\"$product_id\" />\n";
about line 300 to
Code: [Select]
$html = "<input type=\"hidden\" name=\"prod_id\" value=\"$product_id\" />\n";
            $html .= "<input type=\"hidden\" name=\"product_id\" value=\"$product_id\" />\n";

in classes/shop.browse.php change
Code: [Select]
<input type=\"hidden\" name=\"product_id\" value=\"". $db_browse->f("product_id") ."\" />\n
About line 400 to
Code: [Select]
<input type=\"hidden\" name=\"product_id\" value=\"". $db_browse->f("product_id") ."\" />\n
                <input type=\"hidden\" name=\"prod_id\" value=\"". $db_browse->f("product_id") ."\" />\n

This just passes the parent_id as the product_id and provides a different variable for the product_id allowing the form to return to that parent.

This works only if you have added the don't display cart modification as detailed at the begining of this post and my mod in the previous post if you are using php4.

Hope this is of use.

Mark

(p.s. currently working on changing this mod to have only one 'add to cart' button to further improve its functionality i.e. update multiple child items with only one click!)
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 16, 2006, 03:15:42 am
I am attempting to change the file ps_product.attributes.php but note that in my install it's called ps_product.attribute.php instead. (Attribute instead of attributes)

 FTP error 553 permission denied when I try to replace the file, even tho it's CHMOD 777. Have asked my parent web host for help.

Is the difference in file name likely to kill anything?
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 16, 2006, 03:52:14 am
Just a silly spelling mistake on my part.

The file is ps_product.attribute.php

Be sure to back up any file you are going to replace before replacing it. That way if there is something wrong with the files you can easily return to the state it was before modifying anything.

Sorry if this is second nature to you, but it does save on headaches later!

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 17, 2006, 06:57:47 am
Just wanted to say thank you to macallf for writing this mod. I am 1/2 way through installing it and so far it works :) Hoping you are successful in getting the single add item(s) to cart option.
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 17, 2006, 07:50:47 am
Hmmm.

After adding the mods for not going back to the cart and not going to the child item after clicking to add to cart, I seem to have broken the stock checking component.

Info: The selected quantity exceeds available stock. We currently have 0 items available. [Edit: When stock level checking disabled, error changes to Sorry, but the Product you\'ve requested wasn\'t found!]

Guess I've broken something? Will have to revert to unmodded state.

I've also had an effect (after the first mod) not visible on yours where I also see a dropdown box for the item variations available plus the parent product. This would go away when I was in a child display.

Before Mod:
(http://blacksheepwool.com.au/ss0.jpg)

After Mod:
(http://blacksheepwool.com.au/ss1.jpg)

I'll start again from scratch and see if it works out differently- I might have missed a step.

Cheers, Mike.

...later ...

change line 299 from
Code:
.$ps_product_attribute->list_attribute($product_id)


This occurs on line 281 in my original version, which is
 * @version $Id: shop.product_details.php,v 1.12.2.3 2006/01/18 19:40:59 soeren_nb Exp $

Most other line numbers also do not match up so I am guessing that this mod is not for this version?

...later ...

I re-applied the first part of the mod, and end up again with the same as the second screenshot. It also displays the peculiar behaviour (as before) that if I request more than one ball of green wool (the first in the list) it goes to the cart with only one as the quantity. If I do the same for the blue ball, I get the correct quantity but don't get wheeled off to the cart.

I can see other functions there for showing the dropdown boxes. Perhaps if I killed those off it would behave? Can't help but thinking we have different versions? :)
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 17, 2006, 12:49:25 pm
Hi,

I originally wrote the mod for Version 1.0.2 and have recently upgraded to 1.0.3.

as long as the line .$ps_product_attribute->list_attribute($product_id) is changed to .$ps_product_attribute->list_attribute_list($product_id). The function should work. This is just after
Code: [Select]
/* ADD-TO-CART */
  $addtocart = "<div>
    <form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">"
          .$ps_product_attribute->list_attribute_list($product_id)

I have made several modifications to my files But I was sure that I done this on a stock version.

The problem with 0 stock and product not found was a problem I encounted when adding the last part of the modification. The mod that keeps the detail page on the parent page.

If the incorrect prod_id or product_id is sent the product can not be found usually because you are trying to purchase a parent item rather that the child item. I would double check this part of the code.

If you want to return back to dropdowns just change the lines that get the attribbute list back to

.$ps_product_attribute->list_attribute($product_id);;

I've also attached the ps_cart file which could be causing the problems.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 17, 2006, 13:33:27 pm
Thanks :) I'll try again in about 12-18 hours and let you know how it goes :)


...later...

Just to confirm that my screenshots were using the code
Quote
/* ADD-TO-CART */
  $addtocart = "<div>
    <form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">"
          .$ps_product_attribute->list_attribute_list($product_id)
          // added for the advanced attribute modification
          .$ps_product_attribute->list_advanced_attribute($product_id)
          // end added for advanced attribute modification
          .$ps_product_attribute->list_custom_attribute($product_id);
          // end added for custom attribute modification

Would I be correct in guessing tht the list_advanced_attribute and list_custom_attribute are not wanted?

I'll now try the ps_cart.php file you attached :)

...later...
After applying these changes including the new ps_cart.php I am back to produt not found. Reviewing the code, but I fear my lack of programming knowledge will mean I'll have to revert to a 1.0.2 codebase and try again.

...later...

(I'll nuke this post if it's not useful.)

I broke the shop when cPanel suggested an upgrade of Mambo Open Source to Joomla. So, wiped the lot, reinstalled Mambo Open Source, installed the older code base 1.0.2, retained the demo data and am mucking around with it now. I notice with the hammer if I define the extra colours red, green, blue as custom attributes then these items appear in a list as well as the preset options if big little, etc. Have removed the preset attributes from the product and am now to a point of just having the drop-down field for choosing an item. Will now attempt to reapply the mod(s) and see what happens.

...later...

Waiting for parent web hosting provider to change permissions as cPanel file manager blocks any changes to the com_virtuemart folder. (Files are CHMOD 777 but not accessible for changes.) Est wait time 2 hours.
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 18, 2006, 04:31:26 am
You would be wrong in guessing that the list_advanced_attribute and list_custom_attribute are not wanted?
They are!!!

It's hard to tell where it is going wrong. Have you got a link to a live site? If not I've included ps_product.attribute.php and shop.browse_detail.php and shop.browse.php files.
They are modified to work with V 1.0.3

These are stock files that I have modified and tested with my site and they work fine.

Give them a try and see if it helps.

Mark.
(Dont forget to back up your files before you try them)

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 04:40:05 am
Hi Mark :)

As posted above, I killed the live site when an experiment went wrong, so am starting again from 1.0.2 code. Once I get it working in 1.0.2 I'll do another install in a separate location to 1.0.3 and see what happens then :) Since this is the first time I've tried to use VirtueMart, I could well have stuffed something myself. (I've only built one shop before, it was a standard osCommerce site - we have to start somewhere!)
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 18, 2006, 04:49:57 am
Hi cccmikey,

Have you thought about loading Apachce, mysql and php on your local machine and test there. Once it works how you want upload to your host. (I'm running XP so it works in nearly all formats i.e. linux,XP,MAC). This just saves a lot of headaches.

I know it works I've tested it heavily included another screen shot.

Im using:
If I can help at all....

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 05:10:18 am
Hmm I never thought of that before :) Have downloaded & Installed Apache, waiting for 40MB of MySQL and will see what happens next! (512k DSL)
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 06:55:04 am
Installed Apache, PHP4 (since that's what the host is using) and MySQL on XP SP2. Got to a point of installing Mambo and told my sql username and password is not correct. Tried various combinations of root, michael, etc. and in the MySQL console creating a user and granting it permissions. Kinda stuck now :( Any tips appreciated :) No response from host to last email. Will keep reading help files.

...later...

I spent a few hours but never got a happy combination of the three separate packages. From reading online looks like it's possible to get combo packages that do it in one hit whreas downloading and installing each part seems to be a bit of a nightmare. I'll come back to that at another time. The host has got back to me so I can try changing 1.0.2 now :)
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 08:57:12 am
I've gone back to Code base 1.0.2 but note that the line numbers still don't match yours.

I've applied just the first mod to replace the dropdown box, but it's doing the same as it did with the 1.0.3 code - as evidenced on

http://blacksheepwool.com.au/shop/index.php?page=shop.product_details&flypage=&product_id=6&category_id=1&option=com_virtuemart&Itemid=1

(A search for hammer)

(http://blacksheepwool.com.au/ss2.jpg)

I've attached the two patched versions of my files.


...later...

I have another test site using 1.0.3 so I'll try the files you posted earlier.
Waiting for the hosts again...

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 09:44:16 am
I took the three files you had in drop_mod.zip and applied them (and only them) to a VirtueMart 1.0.3 install inside a Mambo install at auzzie.net/shop

Now, all I get is (from www.auzzie.net/shop when clicking a product category)

Fatal error: Call to a member function on a non-object in /home/mccmikey/public_html/shop/administrator/components/com_virtuemart/html/shop.browse.php on line 37

Was that code OK with PHP 4.4.0?

I don't deny at all that you have it working!  I'm happy to give you access to one of the sites if you want to have a play yourself. Perhaps there's something about this shared server that it doesn't like...

(http://blacksheepwool.com.au/ss3.jpg)
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 18, 2006, 13:39:01 pm
Hi cccmikey,

The first site you mention seems to be working apart from the extra add to cart button.

This is because the way I have designed this mod. It expects the parent product to have no price associated with it.

Because there is a price it displays the extra add to cart field. I'll see what I can do to get around this!

The second site is looking for the keyword search variable this is a modification in 1.0.3, did the site work before you applied my patch?

Will keep you posted.

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 18, 2006, 14:02:18 pm
Hi again cccmikey,

Found the problem, it is what I expected. I have now added a query to test if the parent has child items.

If it has child items the extra button will not be displayed.

about line 308 in shop.product_details.php
Code: [Select]
if (USE_AS_CATALOGUE != '1' && $db->num_rows() == 0 && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {

change this to
Code: [Select]
$q = "SELECT product_id,product_name,product_parent_id FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'";
$db->setQuery($q);
$db->query();

if (USE_AS_CATALOGUE != '1' && !$db->num_rows()  && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {

And in shop.browse.php about line 408 change
Code: [Select]
if (USE_AS_CATALOGUE != '1' && $db->num_rows() == 0 && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {
to

Code: [Select]
$product_id = $db_browse->f("product_id");
        $q = "SELECT product_id,product_name,product_parent_id FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'";
$db->setQuery($q);
$db->query();
/*** Add-to-Cart Button ***/
if (USE_AS_CATALOGUE != '1' && !$db->num_rows() && $product_price != "" && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {

the query checks for child items and the condition statement checks that there are no child items.

Difficult to check the second site, if it does work without the modded files added it would seem that it is not a 1.0.3 virtumart site.

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 20:15:30 pm
Hehe I never thought of that re. the parent having a price when it shouldn't! I'll go shortly and try that out.


about line 308 in shop.product_details.php
Code: [Select]
if (USE_AS_CATALOGUE != '1' && $db->num_rows() == 0 && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {



My site has
Code: [Select]
if (USE_AS_CATALOGUE != '1' && $product_price != "" && ($db_product->f("product_parent_id")) == '0' && !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )) {
instead - because it's a 1.0.2. I'll try the 0 price on parent first and then if that doesn't fix it, I'll decide then whether to upgrade the site to 1.0.3 and then try the patches again, or try them in the 1.0.2 code first. :)
Second Server was Your VirtueMart version: VirtueMart 1.0.3 stable  [Little Red Rooster]
10/03/2006 20:21 GMT. Since it was a forgotten experimental site, I might have broken it somewhat earlier, so my apologies.
Title: Re: MOD: Child list instead of drop down.
Post by: cccmikey on March 18, 2006, 20:38:53 pm
Yay! When I created a new parent item with empty price, then created the child items, it worked perfectly! (I note that once you give something a price, the tax calculation script makes it impossible to delete the zero from both 'amount' and 'tax' fields!)

On the product list it shows price as "Call for Pricing" but I imagine there's an easy way to remove that line.

Going to grab some more sleep now! The rest of the modding can wait :)
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 18, 2006, 20:50:12 pm
Hi cccmikey,

sleep, whats that!!!

The previous mod should work on any version!!

The mail to link is in classes/ps_product.php

Code: [Select]
function show_price( $product_id, $hide_tax = false ) {
global $VM_LANG, $CURRENCY_DISPLAY,$vendor_mail;
$auth = $_SESSION['auth'];

$product_name = htmlentities( $this->get_field($product_id, 'product_name'), ENT_QUOTES );
$no_price_html = "&nbsp;<a href=\"mailto:$vendor_mail?subject=".$VM_LANG->_PHPSHOP_PRODUCT_CALL.": $product_name\">".$VM_LANG->_PHPSHOP_PRODUCT_CALL."</a>";

Which I have changed to
   
Code: [Select]
function show_price( $product_id, $hide_tax = false ) {
global $VM_LANG, $CURRENCY_DISPLAY,$vendor_mail;
$auth = $_SESSION['auth'];

$product_name = htmlentities( $this->get_field($product_id, 'product_name'), ENT_QUOTES );

                $no_price_html = "$VM_LANG->_PHPSHOP_PRODUCT_CALL.";
This is about line 1922

I also changed the language file. Look for _PHPSHOP_PRODUCT_CALL this is set to call for pricing. On my site I have changed this to Various sizes available. You couls also just blank it out so that nothing is displayed!

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 19, 2006, 04:53:25 am
Earlier I posted how to correct the don't show cart mod. I have found a side effect in this that throws up errors if you link to a category or details page from outside of your site.

The HTTP_REFERER key hasn't been set to remedy this change

To remedy this change

Code: [Select]
if(strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('category_id')) ||
   strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('product_id')) ||
      strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('shop.browse')) )
      //if has category_id, then add to session or overwrite old referer variable
      {
           $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      }

to

Code: [Select]
if (array_key_exists('HTTP_REFRER',$_SERVER)) {
if(strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('category_id')) ||
   strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('product_id')) ||
      strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('shop.browse')) )
      //if has category_id, then add to session or overwrite old referer variable
      {
           $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      }
}

This checks that the referer key has been set if it hasn't it doesn't do the checks.

Mark
Title: Re: MOD: Child list instead of drop down.
Post by: macallf on March 19, 2006, 17:40:28 pm
Major update to this mod.

I now have a list of products working with a single add to cart button.
(Please see screenshot below.)

This has been tested with

The altered files are


The modification relies on child products but retains all the functionality if no child products exist.

The mod changes the way the cart is displayed, it's not!! Not until you select view cart.

Everytime the add to cart button is clicked the items are updated and the quantity fields are updated from the cart contents. You then stay on your current product page not the cart page.
to update the contents just alter the quantity fields.

If using child products, only the parent product page is displayed, which means descriptions, related products etc are taken from the parent.
no need to duplicate descriptions for like products.

The list now has only 1 add to cart button.

The attached file contains both the modified files and a patch file for those that prefer it.

To install just overwrite the files in /administrator/components/com_virtuemart

PLEASE BACKUP YOUR FILES FIRST
SAVES HEADACHES IF SOMETHING GOES WRONG
[/size][/size]

The modified mini cart can be found here http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=16326.0
 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=16326.0)

New version for 1.0.4 can be found here
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg37613#msg37613

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Amina on March 21, 2006, 11:38:05 am
Hi Mark,

Its good to see that your on top of this mod and not resting until it is perfected......class!

Well I uploaded the files, (but did a backup this time ;D).  I ended up losing visual to the all products.  So basically I could see the list within the orginal virtualmart mod stated the category of products, then I could click on this and get a description of the product category, but would loose all links, images, pricing etc.hmmm. Now could this have anything to do with the existing setup of the product page (it is setup according to the original modification you post at the top) or is that irrelavant as all files are being replaced?
anyways if you want to take the trouble to have a quick look at the site http://www.dermaology.com and assess if it is the existing setup, or just get back to us here.  Excellent work mark.  oh yeah and if you feel you can just log in through my ftp file and update accordingly feel free.  Just for the record folks, I have given access to Mark to my hosting account and ftp with a temporary user name and password.  I want to vouch that he is a man of integrity and honoured me by resolving a previous problem I had with this mod.  ::)
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: cccmikey on March 21, 2006, 12:37:40 pm
I've done a clean install of a shop with Mambo and VirtueMart 1.0.3 and simply replaced the files with those from in his last post. It appears to work fine, as it should. I'm having some other issues with tax and with a user sometimes not being allowed to see prices when they should be able to; but I don't think they are related to this mod.
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 21, 2006, 14:05:31 pm
Hi Amina,

I have edited your files with my mod and everything seems to be working fine apart from the continue shopping button in the cart. This may be because you are using SEF url's and the mod to return you to the correct page is not working correctly in this scenario! I'll check on this and get back to you.

Otherwise it looks good and the cart should function as you expected.

Thanks for the glowing praise it is much appreciated

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Amina on March 21, 2006, 18:31:09 pm
Hi Mark,

Fantastic! ;D

What can I say, the site will be user friendly now and it makes a massive difference.  This part of the site was frustrating me and you have been able to resolve the problem, thank you again.

What would it take to actually create a mod that can be uploaded onto your joomla admin section or is this not possible due to the different files that need modifying?

kind regards

Amina

Your a Star Mark!
Title: Prices disappear for new user? Is it the mod, or is it me?
Post by: cccmikey on March 26, 2006, 14:22:13 pm
I'm having an issue with creating users that I'm not sure if it's related to this mod or not.

If I create a user using the "Not a user? Register" link, that user once logged in can not see prices any more. However, if he/she clicks the Add to cart button, he ends up with one of everything listed in the mod.

If I go into Mambo and make that user an admin then he see prices no worries.

(http://blacksheepwool.com.au/ss6.png)

Log out, or log in as another admin and it works, but log in as a regular user, and the prices disappear.
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 26, 2006, 17:21:11 pm
Hi cccmikey

I think it is problem with virtuemart v1.0.3

check out this link

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=16297.msg34859#msg34859

Still working on the modification for 1.0.4 If found to be working O.K. I will upload the files as a package again.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: fotoshopper on March 26, 2006, 18:52:42 pm
Nice Feature.

I wanted to sell downloads.

Is there a possibility to display checkboxes instead of the quantity?
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 27, 2006, 01:24:52 am
Fine job. Well done. It worked straight away.

However, can a "continue ahopping" button or link be added so that they can get away from the page they're on?

Thanks.

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 27, 2006, 01:45:10 am
Hi

Nig,
Quote
Fine job. Well done. It worked straight away.

However, can a "continue ahopping" button or link be added so that they can get away from the page they're on?

Thanks.

Nig
Trying to work out what youre doing, the only scenario I can come up with is that the customer is being sent to the cart system from a page outside VirtueMart and you want to return them there. VirtuMart and Joomla have their own pathways which should allow customers to return back to somewhere in the site!! My Mod has not changed that in anyway.

The only way would be the store the url of the referer page and store it and compare with virtuemart referer's and ignore them (I think!) and offer a reutn button on the product details page. Not quite sure how to go about this!

If I am correct in my assumptions let me know. If I can think of way around it I will let you know

fotoshopper
Quote
Nice Feature.

I wanted to sell downloads.

Is there a possibility to display checkboxes instead of the quantity?

If all you want to sell is downloads it would be fairly simple to change the forms input type to checkbox's.
if you want to sell other products that are not downloadable it would take a little longer but, I am sure I could come up with something!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 27, 2006, 03:52:05 am
Thanks for the response.

The reason for the post was that in the 'standard' virtuemart, when you add an item to the cart, it then shows you the cart and offers the option at the bottom of going to checkout or continuing to shop. When I add to the cart using your module, i stay on the same page.

I admit that it's easy enough to get round by having the "Your Cart" module showing so they can click on that and check the contents, I was just wondering about going to the cart page direct from the Add to Cart button.

Thanks for your time and effort.

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 27, 2006, 13:23:24 pm
Hi Nig,

Yes that is possible.

in basket.php

remove
Code: [Select]
$loc = $_SESSION['referer'];
     header("Location: $loc");

in shop.browse.php, shop.cart.php & shop.browse_details.php remove these lines
Code: [Select]
if(strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('category_id')) ||
   strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('product_id')) ||
      strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('shop.browse')) ||
        strpos(strtolower($_SERVER['HTTP_REFERER']),strtolower('shop.product_details')) )
      //if has category_id, then add to session or overwrite old referer variable
      {
           $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
      }

in shop.product_details.php change line 336

Code: [Select]
<input type=\"hidden\" name=\"page\" value=\"shop.product_details\" />
to

Code: [Select]
<input type=\"hidden\" name=\"page\" value=\"shop.cart\" />
in shop.browse change line 231

Code: [Select]
<input type="hidden" name="page" value="shop.browse" />
to

Code: [Select]
<input type="hidden" name="page" value="shop.cart" />
and in ps_product_attribute.php change line 299

Code: [Select]
<input type=\"hidden\" name=\"page\" value=\"shop.product_details\" />
to

Code: [Select]
<input type=\"hidden\" name=\"page\" value=\"shop.cart\" />
This should show the cart evertime you update the quantities.

Mark

Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 27, 2006, 16:18:37 pm
WooHoo!!

Now that's what I call service!! Thank you VERY much for the swift and detailed reply!

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 28, 2006, 18:49:53 pm
OK, I might be picky here, but I have a problem in that I cannot seem to add Quantity discount pricing (via the List Prices option). WHatever I do, it still says the original price. I was hoping I could do this solely onthe parent product (after all, I am trying to get people to pick and mix designs within a single item group), but does this mean I have to go into each item individually and add the discount there? And, if I do, will that allow the discount to be calculated for different items within that parent product?

To be clear, assume the following:

I have a product: BOX

Each BOX can be in different colors and customers can buy any number of different colored boxes. If they buy ANY four boxes (of whatever color) they can get a discount of X%.

Is that a no-go for this module?

And, if it is (or isn't), how in heck do I achieve it anyway?

Thanks for any input at all.

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: fotoshopper on March 28, 2006, 20:26:06 pm
Is there a possibility to display checkboxes instead of the quantity?
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 28, 2006, 21:12:45 pm
Hi Nig,

I see what you mean, discount is applied per child product. Let me look into it and I will see what I can do.

fotoshopper

I've got a mod that will show downloadable products with radio boxes as in the image below. I'm having problems getting a checkbox working but I'm still looking into it.

If the radio boxes will do let me know and I will post the modification

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 28, 2006, 21:29:18 pm
Thanks Mark,

It's good of you to look into it. I appreciate it!

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 28, 2006, 21:39:06 pm
Hi Nig,

the problem lies in the standard dropdown method of virtuemart, it checks for discount per child not based on the parent.

I have to find some way of checking each items quantity in the list and alter the discounted price based on the total quantity selected. This may take awhile to sort out, but I am looking into it.

I will get back to you when I find a solution.

If anybody else has any ideas on this it would be appreciated.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 28, 2006, 22:29:08 pm
Hi nig,

did not take as long as I thought!!!!

in classes/ps_cart.php change about line 168

Code: [Select]
$_SESSION['cart'][$k]["quantity"] = $quantity;
    $_SESSION['cart'][$k]["product_id"] = $product_id;
    // added for the advanced attribute modification
    $_SESSION['cart'][$k]["description"] = $e["description"];
    $_SESSION['cart']["idx"]++;

to

Code: [Select]
$_SESSION['cart'][$k]["quantity"] = $quantity;
    $_SESSION['cart'][$k]["product_id"] = $product_id;
                $_SESSION['cart'][$k]["parent_id"] = $e["product_id"];
    // added for the advanced attribute modification
    $_SESSION['cart'][$k]["description"] = $e["description"];
    $_SESSION['cart']["idx"]++;

in classes/ps_product.php about line 1503  in function get_price change

Code: [Select]
$quantity = 0;
                for ($i=0;$i<$cart["idx"];$i++) {
if ($cart[$i]["product_id"] == $product_id) {
$quantity += $cart[$i]["quantity"];
}
}

to

Code: [Select]
$quantity = 0;
                $parent_id = "";
                $q = "SELECT product_price, product_price_id, product_currency FROM #__{vm}_product_price WHERE product_id='$product_parent_id' AND ";
$q .= "shopper_group_id='$shopper_group_id'  ORDER BY price_quantity_start";
$db->setQuery($q);
                $db->query();
if ($db->next_record()) {
                    $parent = true;
                    }
                    else {
                    $parent = false;
                }
                for ($i=0;$i<$cart["idx"];$i++) {
                    if ($cart[$i]["product_id"] == $product_id) {
                        if ($parent)
                            $parent_id  = $cart[$i]["parent_id"];
                        else
                            $quantity += $cart[$i]["quantity"];
                    }
                }
                if ($parent) {
                    for ($i=0;$i<$cart["idx"];$i++) {
                        if ($cart[$i]['parent_id'] == $parent_id) {
                            $quantity  += $cart[$i]["quantity"];
                        }
                    }
                }

This will now generate the correct discount based on the parent_id of the product instead of the product_id if the parent has prices defined.

Notes On Use

If you want discount based on individual child product do not set price in parent.
if you want discount based on total number of child products, set price in parent and not in children.

Hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 29, 2006, 14:31:47 pm
Hi fotoshopper,

I have got the checkbox for downloadable products finished, there are quite a few modifications to make; so here goes.

in languages/english.php

add at about line 63

Code: [Select]
var $_PHPSHOP_CART_DOWNLOAD = 'Download';
in classes/ps_product.php add this function at the end before the last '}'

Code: [Select]
function downloadable($product_id) {
    $db_check = new ps_DB;
        $q_dl = "SELECT attribute_name,attribute_value FROM #__{vm}_product_attribute WHERE ";
$q_dl .= "product_id='".$product_id."' AND attribute_name='download' ";
$db_check->query($q_dl);
$db_check->next_record();
        if ($db_check->num_rows() > 0) {
            return true;
            }
        else {
            return false;
            }
       
    }

this just checks if the product is downloadable.

in classes/ps_product_attribute.php change

Code: [Select]
$html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td><td align='right'>";
                    $html .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
                            <input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity[]\" name=\"quantity[]\" value=\"".$quantity."\" style=\"vertical-align: middle;\" />&nbsp;";
                   

about line 285

to
Code: [Select]
$html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td><td align='right'>";
if ($ps_product->downloadable($db->f("product_id")) == false) {
                        $html .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
                        <input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" style=\"vertical-align: middle;\" />&nbsp;";
                            }
                    else {
                        $html .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_DOWNLOAD.":</label>
                        <input type=\"hidden\" class=\"checkbox\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" />&nbsp;
                        <input type=\"checkbox\" class=\"checkbox\" id =\"check[]\" name=\"check[]\" value=\"1\" ";
                        if ($quantity > 0 )
                            $html .= "checked=\"checked\"";
                       $html .= " value=\"1\" style=\"vertical-align: middle;\" onClick=\"javascript: if(this.checked==true) document.getElementById('quantity".$db->f("product_id")."').value = 1; else {document.getElementById('quantity".$db->f("product_id")."').value=0;} \"/>&nbsp; ";
                       
                        }

in html/shop.product_details.php change

Code: [Select]
        $addtocart .= "Size: as per description</td><td>".$CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td><td align='right'>
        <label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
            <input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity[]\" name=\"quantity[]\" value=\"".$quantity."\" style=\"vertical-align: middle;\" />&nbsp;
 

about line 316 to

Code: [Select]
$addtocart .= "Size: as per description</td><td>".$CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td><td align='right'>";
if ($ps_product->downloadable($db->f("product_id")) == false) {
                        $addtocart .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
                        <input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" style=\"vertical-align: middle;\" />&nbsp;";
                            }
                    else {
                        $addtocart .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_DOWNLOAD.":</label>
                        <input type=\"hidden\" class=\"checkbox\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" />&nbsp;
                        <input type=\"checkbox\" class=\"checkbox\" id =\"check[]\" name=\"check[]\" value=\"1\" ";
                        if ($quantity > 0 )
                            $addtocart .= "checked=\"checked\"";
                        $addtocart .= " value=\"1\" style=\"vertical-align: middle;\" onClick=\"javascript: if(this.checked==true) document.getElementById('quantity".$db->f("product_id")."').value = 1; else {document.getElementById('quantity".$db->f("product_id")."').value=0;} \"/>&nbsp; ";
                        }

and finally in html/shop.browse.php change

Code: [Select]
$form_addtocart = "<form action=\"". $mm_action_url ."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart".$i."\">\n
                <label for=\"quantity_".$i."\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>\n
                <input id=\"quantity_".$i."\" class=\"inputbox\" type=\"text\" size=\"3\" name=\"quantity\" value=\"".$quantity."\" />

about line 406 to

Code: [Select]
            $form_addtocart = "<form action=\"". $mm_action_url ."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart".$i."\">\n";
            if ($ps_product->downloadable($db->f("product_id")) == false) {
                        $form_addtocart .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
                        <input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" style=\"vertical-align: middle;\" />&nbsp;";
                            }
                    else {
                        $form_addtocart .= "<label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_DOWNLOAD.":</label>
                        <input type=\"hidden\" class=\"checkbox\" id=\"quantity".$db->f("product_id")."\" name=\"quantity[]\" value=\"".$quantity."\" />&nbsp;
                        <input type=\"checkbox\" class=\"checkbox\" id =\"check[]\" name=\"check[]\" value=\"1\" ";
                        if ($quantity > 0 )
                            $form_addtocart .= "checked=\"checked\"";
                        $form_addtocart .= " value=\"1\" style=\"vertical-align: middle;\" onClick=\"javascript: if(this.checked==true) document.getElementById('quantity".$db->f("product_id")."').value = 1; else {document.getElementById('quantity".$db->f("product_id")."').value=0;} \"/>&nbsp; ";
                        }
$form_addtocart .= "

hope this is of help to you. Check the screenshot below.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: cccmikey on March 29, 2006, 15:20:12 pm
Quote
Still working on the modification for 1.0.4 If found to be working O.K. I will upload the files as a package again.

Hi Mark :) How you going with this one? :) I'm about to upgrade to 1.0.4 so not sure if I can use the existing mods again. Cheers, Mike.
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: Nig on March 29, 2006, 16:28:55 pm
Quote
This will now generate the correct discount based on the parent_id of the product instead of the product_id if the parent has prices defined.

Notes On Use

If you want discount based on individual child product do not set price in parent.
if you want discount based on total number of child products, set price in parent and not in children.

Hope this helps

Mark

You are an absolute star!!

Can't thank you enough! Wonderful work!

Nig
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 29, 2006, 18:44:34 pm
Hi cccmikey

Quote
Quote
Still working on the modification for 1.0.4 If found to be working O.K. I will upload the files as a package again.
Hi Mark  :) How you going with this one?  :) I'm about to upgrade to 1.0.4 so not sure if I can use the existing mods again. Cheers, Mike.

In the final stages of testing this on 1.0.4 if everything is OK I will post tomorrow. Still deciding whether to include all the modifications as discussed in previous posts!!!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: cccmikey on March 30, 2006, 00:13:07 am
Great :) Heh with all these options you have now, you almost need your own admin section to configure them! I hope you're finding time to eat, etc! You seem flat out on these!
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: savage1 on March 30, 2006, 03:04:11 am
macallf: You do exellent job! Great thanks. That's all options i need.  :D

Is it possible to display child product in product_details list as link to full child_product page?

Thanks again ^-^
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 30, 2006, 03:21:13 am
Hi savage1,

It should be possible, but it would still show all the child products as a list. The only thing that would be different is the child products image and descriptions would be used and not the parents.

Possibly the best way to do this would be a link on the childs description field!

To do that change ps_product.attribute.php at about line 249

Code: [Select]
$html .= $db->f("product_name") ."</td><td>";

// For each child get attribute values by looping through attribute list

change this to

Code: [Select]
                $flypage = $ps_product->get_flypage($db->f("product_id"));
                $url = $sess->url($mm_action_url . "index.php?page=shop.product_details&flypage=$flypage&product_id=".$db->f("product_id"));
                $html .= "<a href=\"$url\">";
$html .= $db->f("product_name") ."</a></td><td>";

// For each child get attribute values by looping through attribute list

in the globals section of the function about line 202 change

Code: [Select]
global $VM_LANG, $CURRENCY_DISPLAY,$mm_action_url;
 

to

Code: [Select]
global $VM_LANG, $CURRENCY_DISPLAY,$mm_action_url,$sess;
 

This will give you a link on each child description. Clicking update cart will however take you back to the parent.

Hope this helps

Mark

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 30, 2006, 22:09:23 pm
Hi savage,

 in response to your message, I think this is what you want.


if you alter ps_product.attribute.php about line 238

Code: [Select]
// Start row for this child
replace this with

Code: [Select]
if (($db->f("product_id") <> $curr_product) && @$child_id)
                    continue;
// Start row for this child

and change line 207

Code: [Select]
$category_id = mosGetParam( $_REQUEST, 'category_id', "" );

to

Code: [Select]
$category_id = mosGetParam( $_REQUEST, 'category_id', "" );
        $curr_product = mosGetParam( $_REQUEST, 'product_id', "");

and change line 244

Code: [Select]
               
                    $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$parent_id."\">";
             

to

Code: [Select]
                if (@$child_id) {
                    $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$db->f("product_id")."\">"; }
                else {
                    $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$parent_id."\">";
                }

This will display a child page when the link to child is pressed. Still looking at the pathway problem but this is nearly done.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 30, 2006, 23:59:28 pm
Hi savage,

Found a dirty hack around your pathway problem. The pathway is made up of categories with the last parent product being displayed. This would take some reworking to work with this.

This just adds the parent to the pathway and is selectable.

change \html\shop.product_details.php after line 139

Code: [Select]
$navigation_pathway .= " ".$ps_product_category->pathway_separator()." ". $product_name;
add

Code: [Select]
  $parent_id_link = $db_product->f("product_parent_id");
  $return_link = "";
  if ($parent_id_link <> 0 ) {
    $q = "SELECT product_name FROM #__{vm}_product WHERE product_id = '$product_parent_id' LIMIT 0,1";
    $db->query( $q );
    $db->next_record();
    $product_parent_name = $db->f("product_name");
    $return_link = "Return to&nbsp;<a class=\"\" href=\"";
    $return_link .= $sess->url($_SERVER['PHP_SELF'] . "?page=shop.product_details&product_id=$parent_id_link");
    $return_link .= "\">";
    $return_link .= $product_parent_name;
    $return_link .= "</a>";
    $navigation_pathway .= " ".$ps_product_category->pathway_separator()." ". $return_link;     
    }

Hope this helps
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on March 31, 2006, 18:43:14 pm
Hi all

Have just updated this for VM 1.0.4

All the modifications listed on this post have been included.

The other modifications have been discussed on this post apart from the last one.

for this there is an extra file. If the file doesn't exist there is no change to way the browse page works.

This file is in \html\templates\browse

this is the footer file. For any category that you want this mod applied to create a new file based on browse file with an extension of _footer.

i.e.
Category 1 has a browse page of browse_1.php and no footer file : this shows the page as normal
Category 2 has a browse page of browse_2.php and a footer file of browse_2_footer.php this shows this category with the new addtocart button for all products on the page.   ???

It just adds a lot more functionality to this mod, most of the work had been done anyway.

The screenshot below should explain what I mean.

Hope this all makes sense  :o

this was from a request in this post http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=13177.0

Possible further modification are to include a parameter per product that will allow you to select list or dropdown per product. Let me know what you think!!

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on April 06, 2006, 16:23:41 pm
Hi All,

update for this mod.

This adds a parameter to the product list to allow you to choose list or dropdown per product parent.

Basically there is a check box under the publish check box. If its checked you will have a list of child products, unchecked the standard dropdown.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: mosey on April 10, 2006, 07:56:51 am
Thanks to a link from gursikh on the IRC channel - I've just found out about this mod :D really impressed - thanks much for all the work macallf! :)
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: BigBang on April 17, 2006, 08:26:15 am
Hello, thanks for this nice Hack. My Version of Virtuemart 1.0.4 and Joomla 1.0.8

Could somebody help me out ?

I will also pay for this updated hack.

1. like to have 1 add to cart Button each line on child list
2. Like to have 1 article default into the inpotbox not 0 or current articlenumber.


THX aLot
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: gybfefe on May 03, 2006, 17:56:05 pm
Thanks to a link from gursikh on the IRC channel - I've just found out about this mod :D really impressed - thanks much for all the work macallf! :)
Hello I write to you because it's easier to find the irc channel anyway the big problem that there's
no solution for taxes at items or attributes or both....
They show the pure price without any tax. Everything else works fine in any combination of
tax related questions but when items or attributes come into the picture, only the products
without them shows the taxes at cart's summery.
Maybe 1.0.2 worked in his time with the hack of ps_product_attribute.php on line 314
but 1.0.4 is corrected with this hack and just doesn't work.
Any idea? or I have to set up an irc client ???
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: macallf on May 03, 2006, 19:26:18 pm
Quote
Hello I write to you because it's easier to find the irc channel anyway the big problem that there's
no solution for taxes at items or attributes or both....
They show the pure price without any tax. Everything else works fine in any combination of
tax related questions but when items or attributes come into the picture, only the products
without them shows the taxes at cart's summery.
Maybe 1.0.2 worked in his time with the hack of ps_product_attribute.php on line 314
but 1.0.4 is corrected with this hack and just doesn't work.
Any idea? or I have to set up an irc client

Hi

Is this question related to this mod?

If so, more of an explanation of the problem is required.

Otherwise you need to post this question elsewhere!!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: gybfefe on May 03, 2006, 19:47:03 pm
I just looking after gurus whose can solve this terrible situation....
Hoped maybe at least there's a display workaround on item or atrrib tax showcase
sorry if I confused the cat
Title: Re: MOD: Child list instead of drop down. UPDATE Single add to cart button
Post by: gybfefe on May 03, 2006, 21:57:18 pm
A big sorry from everybody!
I didn't know that simple tax means shipping tax according to virtual tax...
for gurus
I was the cat
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: gforce701 on May 12, 2006, 11:57:22 am
Hey Mark,

Great mod. I'm having an issue with 1.05. I'm not seeing the check boxes. Only see one add to cart button but not working the way the last version did. The only file I did not load is the language file (current file is highly customized). Is the language file critical to this showing the check boxes?

Thanks for your work on providing us this mod!
Grant
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: Bruce Morgan on May 12, 2006, 17:42:15 pm
Okay after reading five pages of posts, I am not quite sure what this mod does.  I guess I need to know what a child prduct is.  It seems from the example on the first page that the art piece is available in three different sizes and all are shown together.  Would each piece have its own SKU?  If the the three items are child product where is the "parent"?  Am I the only one who does not understand this???

Bruce
ww.pepper-passion.com
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on May 12, 2006, 19:35:56 pm
Okay after reading five pages of posts, I am not quite sure what this mod does.  I guess I need to know what a child prduct is.  It seems from the example on the first page that the art piece is available in three different sizes and all are shown together.  Would each piece have its own SKU?  If the the three items are child product where is the "parent"?  Am I the only one who does not understand this???

Bruce
ww.pepper-passion.com

A child product is a way to sell different versions of the same product, each child has its own sku and stock levels prices etc, just like any other products. The parent product is the holder for the child products. Anything set in the parent product is carried over to the child e.g. description. But the child product can have its own description and this will take presedence.

VirtueMart will display a parent product and present a dropdown box for you to select the child you wish to purchase, this then reloads the page with that child.

My Mod just shows all child products in a list. If youre selling something thats available in 4 different colours and nothing else is different, why make the user choose a colour - be presented with another page and then make the purchase? This just displays all colours and you choose how many you would like of each.

Child products are discussed in other posts, do a search to get more info.

Hey Mark,

Great mod. I'm having an issue with 1.05. I'm not seeing the check boxes. Only see one add to cart button but not working the way the last version did. The only file I did not load is the language file (current file is highly customized). Is the language file critical to this showing the check boxes?

Thanks for your work on providing us this mod!
Grant

I'll check this out and get back to you

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on May 12, 2006, 20:37:47 pm
Hi

I have just updated this to work with VirtueMart 1.0.5

There were a few inconsistencies with the last upload.

I have checked every aspect with all the options and works the same way as before.

There has been since verion 1.0.4 a single add to cart button, just for those that missed it. Downloadable items are displayed using a check box.

The details page now displays a formatted style (table row) for the product details.

The tables have a class name of "child_list"

and use the SEARCH_COLOR_1 and SEARCH_COLOR_2 for row styling.

plus made some changes to the way it works and sorted out some bugs.

No differences to end user.

Enjoy

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: gforce701 on May 13, 2006, 18:33:25 pm
Hi Mark,
Still no quanity fields or check boxes showing. Any suggestions?
Thanks.
Grant
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on May 13, 2006, 20:08:27 pm
Only 1 reason comes to mind, you have the cart configured as a catalogue. This will then not display the quantity or download or add to cart.

If this is not case then I will look into it further.

Mark

edit

2nd case comes to mind, youre not using VM 1.0.5, this update is to work with VM 1.0.5,
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: gforce701 on May 14, 2006, 20:14:17 pm
Mark,
I'm using the latest ecommerce edition (Joonla 1.0.8 Stable & VM 1.0.5). Maybe there is something goofy with the combined package. I'll uninstall VM and reinstall it normally and see if that works.

Thanks again for this mod!

Grant
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on May 14, 2006, 23:19:03 pm
Mark,
I'm using the latest ecommerce edition (Joonla 1.0.8 Stable & VM 1.0.5). Maybe there is something goofy with the combined package. I'll uninstall VM and reinstall it normally and see if that works.

Thanks again for this mod!

Grant

Just to check, I have done a clean install of J! 1.0.8 and VM 1.0.5

Installed the mod and it worked, infact I've installed 3 different mods and gone back to the drop down mod and it still works!

So, I don't know what the problem is, unless as you say, it's the ecommerce edition.

Good luck and let me know.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: gforce701 on May 14, 2006, 23:58:33 pm
I reverted back to 1.0.4 and it works perfectly.

There must be something strange with the eccommerce edition. I don't have time to track it down right now but will be doing a clean install for another site tomorrow night and will try it with joomla 1.0.8 and vm 1.0.5 (instead of the eccommerce edition).

I expect to confirm the mod works as you have designed it to on a full clean install.
Thanks again!!
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mark R on June 16, 2006, 15:31:30 pm
I have installed this mod.... great mod.

Unfortunatly i have a problem with the prices - i only allow access to prices/add to cart for registered users, this mod allow access to cart & prices without being registered.

any suggestions to while file controls price access rights?

thanks in advance
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on June 16, 2006, 19:38:00 pm
Hi mark R,

sorry about that! Only one line to change in ps_product.attribute.php

change this line

// Attributes for this item are done.
// Now get item price
   if( _SHOW_PRICES == '1') {

to

// Attributes for this item are done.
// Now get item price
   if( $_SESSION['auth']['show_prices']) {

this will sort the problem.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: mark R on June 16, 2006, 21:57:59 pm
thanks for replying...

I have modified as suggested but it has made no difference.

1) The problem is when a product does not have any child products. the price and the add to cart of the parent product show(should be hidden until logged in).

2) on products which have a child products price does not show but 'add to cart' does

3) if i click on a child product it changes the details page to the correct child product, but then shows the 'price' and the 'add to cart' button going off the page to the right?

i shall try and have a dig around myself but if you have any suggestions would be much appreciated

thanks again.

mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on June 16, 2006, 22:20:16 pm
Hi again,

you will have to alter shop.product_details.php and make the same change.

Also change any occurence of this

if (USE_AS_CATALOGUE != '1' )

to

if (USE_AS_CATALOGUE != '1' && $_SESSION['auth']['show_prices'])

this will remove the add to cart and quantity fields.

hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: gwilym on July 07, 2006, 02:20:15 am
I am after a mod which I can enter more than one product to the cart when one button is pushed. Does anybody know if this mod will do this?

The idea is like a PC builder page where you select different components then click on 'go' and it enters them all into the cart...except we want to use it to sell coffee beans....

Any help apprciated...

Gwilym
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: macallf on July 07, 2006, 19:10:33 pm
Hi

This mod can do that, it depends on how you set it up.

You can use it to add products from the browse page instead of the details page.

See this post http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg37613#msg37613

Should answer the question.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: midwestkel on July 21, 2006, 00:55:12 am
Mark.

Does this still work with the upgrade to 1.0.6?

I upgraded when I upgraded J! to 1.0.10 and forgot about the mod then I saw my pages all screwed up.

Thanks again.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: midwestkel on July 25, 2006, 16:28:38 pm
Ok I updated the files to work with VM 1.0.6

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: teamit on July 25, 2006, 16:48:12 pm
Hi!

Tryed this module...

But get this error message:

Fatal error: Call to undefined function: show_featured() in /home/jmdata/www/joomblashop/modules/mod_virtuemart_featureprod_ext.php on line 128

What is going on here, is there somthing missing here ?

Tor
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: midwestkel on July 25, 2006, 19:43:54 pm
Are you using my files? And what version of VM are you using?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: mark R on July 26, 2006, 17:41:32 pm
Hi all,

I have installed dropdownmod106.

I have 2 small issues

1) prices was showing for all users(i only allow prices for registered) i have tweaked and it works fine now.
2) prices in the attribute list doesnt show price with the discounts
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: midwestkel on July 26, 2006, 19:11:24 pm
mark R.

I dont know how to change that part
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: eda on July 27, 2006, 17:02:01 pm
I've done those changes and i'm so glad, Thankyou.

.... but I need help, I want to add a field that shows the number of stock (on the child list) for each child-product  and to hide the price also (that is the same for all of them).

at last I need to show a feedback  message "your product has been added to Cart" when click to the Add to Cart and rederect the user to the page of the listed products of the parent category, or, if that is so complicated (the message etc), simply to show the page of cart every time that click on add to cart. (i use the last version of VirtueMart)



Someone can tell me how?

Eda
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: eda on July 27, 2006, 20:47:31 pm
Hi everybody,

I need help because in the child list i have to show the number of item available in the stock.
In the list appeare the name (as a link) of the child item, the atribute, the price and the add to cart function.

I need to show also the number of item available referred to each child item.
How I can do?

There is another problem,

Following the link carried by the name of the child item i enter a page dedicated to product details and in this page there is the add to cart function but the function doesn't work, it doesn't update the shopping cart. Any suggestion?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.5)
Post by: Andrew on August 13, 2006, 11:31:50 am
Am I blind, how do you add a child product to the main product to make this mod work?
Thanks
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 13, 2006, 18:08:09 pm
Hello Folks,

I've been offline for awhile due to a processor meltdown!!!!

Thanks to midwestkel for his good work in providing an update for 1.0.6 while I was offline.

only 2 files were modified in the classes directory - ps_product.php and ps_product_attribute.php

One line in one of these files was incorrect but I have modified this and provided an updated language file

I've also altered shop.product_details.php to provide for better handling of child products when on the child product page,

I hope this helps.

Am I blind, how do you add a child product to the main product to make this mod work?
Thanks
Andrew
Adding child products is explained in other forums and is in the documentation, if you are still having problems after reading them then pm me.

I've done those changes and i'm so glad, Thankyou.

.... but I need help, I want to add a field that shows the number of stock (on the child list) for each child-product  and to hide the price also (that is the same for all of them).

at last I need to show a feedback  message "your product has been added to Cart" when click to the Add to Cart and rederect the user to the page of the listed products of the parent category, or, if that is so complicated (the message etc), simply to show the page of cart every time that click on add to cart. (i use the last version of VirtueMart)

Someone can tell me how?

Eda

You can turn off the prices in VM in the configuration page, adding a field can be done to show stock levels. I'll look into it and post an answer when I have done.
You can turn off the page redirection, it does mean changing a few files. Somewhere in this post I have a link to how I turned it on, check that out and remove the mods I made.

You could instead modify the ps_cart.php file in classes. at the end of the add, updtae and delete functions replace the

return true;

with

$vmLogger->tip( 'Cart updated' );
return True;

This will display Info: Cart updated at the top of the page

Hope all this helps


[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 14, 2006, 19:16:42 pm
Hi everybody,

I need help because in the child list i have to show the number of item available in the stock.
In the list appeare the name (as a link) of the child item, the atribute, the price and the add to cart function.

I need to show also the number of item available referred to each child item.
How I can do?

There is another problem,

Following the link carried by the name of the child item i enter a page dedicated to product details and in this page there is the add to cart function but the function doesn't work, it doesn't update the shopping cart. Any suggestion?

I have added a zipped file for eda with 2 modified files, ps_product_attribute.php and shop.product_details.php

I have modified these to show the current stock level. I have commented the files to show the relevant additions.

The file is stock_level.zip.

just overwrite the relevant files in classes and html.

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 14, 2006, 19:18:50 pm
I have modified the main mod to have a selectable field for displaying child links from the list of products.

The screen shot shows where the field is selected in the backend. Obviously some people dont require a link to the child product as all the info is available from the parent, instead of modifying the files to turn this off it can now be selected on a by product basis.

The basket has also been modified to show downloadable products with checkboxes, the same as on the detail pages.
It made sense to do this as you're only going to buy one of these at a time!!!

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Andrew on August 15, 2006, 03:19:39 am
Hi Mark,

Works great, thanks, now that I have figured out the child item. Only thing is that when you add the quantities in it just refreshes the page. Can it be modified so that when you add to cart, it goes to the checkout, as per the vanillia copy of VM?
Thanks
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 15, 2006, 20:08:38 pm
Hi Mark,

Works great, thanks, now that I have figured out the child item. Only thing is that when you add the quantities in it just refreshes the page. Can it be modified so that when you add to cart, it goes to the checkout, as per the vanillia copy of VM?
Thanks
Andrew

Hi Andrew

if you check this post it gives the details for removing the mod that causes the page to just refresh without going to the cart

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg36781#msg36781

The line numbers may be slightly different but the method is the same. Just find the relevant lines in each file and do the same modification.

Hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: jjk on August 16, 2006, 21:26:19 pm
Hi Mark,

I moved my reply to your answer to this thread because its related to your modification:

Hi jjk,

my mod that allows a list of child products does provide the functionality you require, but using just one add to cart button.

Earlier versions did use an add to cart for each child and it probably wont be to difficult to modify it back to that way of working...

Mark

Good work! I did install your modification and it is working. The only thing I have to adjust is the first column holding the description of the products. Its default width is too narrow for my descriptions and I just have to figure out where to adjust the column width. Everything else is just fine. Thanks!

Joerg
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 17, 2006, 01:29:57 am


Good work! I did install your modification and it is working. The only thing I have to adjust is the first column holding the description of the products. Its default width is too narrow for my descriptions and I just have to figure out where to adjust the column width. Everything else is just fine. Thanks!

Joerg


2 files to modify:-

ps_product.attribute.php  - for the child items

starting at line 270

// Create array for this child
                $count_attrib = $this->count_advanced_attribute($product_id);
                $html .= "<input type=\"hidden\" name=\"prod_id[]\" value=\"".$db->f("product_id") ."\"><td align=left width='30%'>";
                if (@$child_id) {
                    $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$db->f("product_id")."\">";
                     }
                else {
                    $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$parent_id."\">";
                   
                }

I've highlighted the relevant figure

and for items without children

shop.product_details.php

starting at line 368

       $addtocart .= "<form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">";     
        $addtocart .= "<input type=\"hidden\" name=\"prod_id[]\" value=\"$product_id\" />\n
         <input type=\"hidden\" name=\"product_id\" value=\"$product_id\" />\n
        <input type=\"hidden\" name=\"parent_id\" value=\"$product_id\" />\n
      <table width=\"100%\" style=\"vertical-align: middle;\" class=\"child_list\">
       
                <tr style=\"vertical-align: middle;\" >";
     
        $addtocart .="<td align='left'>".$db_product->f("product_name")."</td>";

change this last line to

        $addtocart .="<td align='left' width='xx'>".$db_product->f("product_name")."</td>";

where xx is the width you require.

I hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: jjk on August 17, 2006, 20:19:43 pm
Hi Mark,

The problem seems to be a little more complicated.

If I change the the width in line 272 of ps_product_attribute.php to i.e. 50%, it adjusts the left column of the table when you look at it with Internet Explorer. With the Firefox browser (pretty popular here in Germany) I don't see any change. The total "Add to Cart" table width seems to be set elswhere. See image below:

(http://)

My current "Add to Cart" tables' html souce code is below:

Code: [Select]
<td colspan="2"><br><form action="http://localhost:8888/joomla/index.php" method="post" name="addtocart" id="addtocart"><input name="prod_id[]" value="37" type="hidden"><input name="prod_id[]" value="41" type="hidden"><input name="prod_id[]" value="39" type="hidden"><table class="child_list" align="left" width="100%"><tbody><tr bgcolor="#d31b1b"><td align="left" width="50%"><input name="product_id" value="36" type="hidden">Peaceful Anchorage Artists Proof</td><td align="right"> </td><td align="right"> </td><td align="right"> </td><td align="right" width="10%">€298.00</td><td align="right" width="12%"><label for="quantity" style="vertical-align: middle;">Quantity:</label>
                            <input class="inputbox" size="4" id="quantity37" name="quantity[]" value="0" style="vertical-align: middle;" type="text"></td></tr><tr bgcolor="#f9f9f9"><td align="left" width="50%"><input name="product_id" value="36" type="hidden">Peaceful Anchorage</td><td align="right"> </td><td align="right"> </td><td align="right"> </td><td align="right" width="10%">€222.00</td><td align="right" width="12%"><label for="quantity" style="vertical-align: middle;">Quantity:</label>
                            <input class="inputbox" size="4" id="quantity41" name="quantity[]" value="0" style="vertical-align: middle;" type="text"></td></tr><tr bgcolor="#d31b1b"><td align="left" width="50%"><input name="product_id" value="36" type="hidden">Peaceful Anchorage Remarque</td><td align="right"> </td><td align="right"> </td><td align="right"> </td><td align="right" width="10%">€400.00</td><td align="right" width="12%"><label for="quantity" style="vertical-align: middle;">Quantity:</label>

                            <input class="inputbox" size="4" id="quantity39" name="quantity[]" value="0" style="vertical-align: middle;" type="text"></td></tr><tr><td colspan="5"></td><td align="right"><input style="border: medium none ; background: transparent url(http://localhost:8888/joomla/components/com_virtuemart/shop_image/ps_image/add-to-cart_green.gif) no-repeat scroll left center; overflow: hidden; text-align: center; width: 160px; height: 35px; cursor: pointer; font-weight: bold; font-family: inherit; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; vertical-align: middle;" value="Add to Cart" title="Add to Cart" type="submit">
            <input name="flypage" value="shop.gallery_flypage" type="hidden">
                            <input name="page" value="shop.product_details" type="hidden">
                            <input name="func" value="cartAdd" type="hidden">
                            <input name="option" value="com_virtuemart" type="hidden">
                            <input name="Itemid" value="1" type="hidden"></td></tr></tbody></table></form> </td>

Your modification also adds (in my case) three empty cells between the left "Product description cell" and the cell holding the price. Did you do that just as a "visual spacer" or are these cells intended to show a certain content? I thought of adding a width limitation to the quantity cell in order to have more space for the left "Description cell" but I'm not shure where to place it within your code.

Also, I didn't find the file that controls the "Add to Cart" tables' total width. Would be nice if I could set it to 75 percent or even 100 percent width to match the parameter table below.

Best Regards

Joerg

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 18, 2006, 19:15:48 pm
Hi jjk,

I use firefox all the time for development, the table width is set at 100%, the empty cells are product attributes and are probably not empty, just not displaying correctly!!!

I would suggest that this is in fact a template problem.

If you have a live site pm me your site address and I'll take a look.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: jjk on August 18, 2006, 23:08:55 pm
Hi Mark,

Thanks for your offer to have a look. Unfortunately my current Joomla/Virtuemart experiments are still on localhost, as I'm living in a non-DSL (fibreglass cable) area without flatrate. However, the telephone company promised to install DSL to our fibreglass cables in fall.

I have two operational web sites, but they are both still static content done with NetObjects Fusion. The one I would like to change to a Joomla/VirtueMart/MySql system www.kiekebusch.com (http://www.kiekebusch.com) currently holds about 1000 art prints for sale. I would like to add many more images and site features, which are not possible with NOF Fusion.

Meanwhile I noticed that the "Add to Cart" table width shares the total available width with the table holding the thumbnail image because it is nested into the bigger table. The "Add to Cart" column starts where the column holding the thumbnail ends. I've added a snapshot showing the table with HTML Tags to illustrate the current setup.

(http://)

I suppose I can alter the layout by either getting rid of one of the TDs left of the "Add to Cart" table or by moving it down one row. I will try this early next week, because I have to do other work the next two days.

The three empty cells don't hold any placeholders, so I assume they are just empty. If I change the Joomla template, they don't go away either. They are not present if there are no child products. Again, I will play with that on Monday.

Concerning the thumbnails (all my thumbnails are 175 pixels in width) disappearing in Internet Explorer, there were other messages in this forum describing a similar problem. But their solution didn't work for me. See http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=18539.msg43537#msg43537

Best Regards

Joerg

[attachment deleted by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 19, 2006, 12:51:53 pm
Hi,

Wow this is some superb work you have done here, I have just implemented your latest mod to my site, I have one (ok maybe two) teeny weeny requests, even if you just point me in the right direction I would be happy to do this myself.

What I would like is headings for my child list, at the moment things are looking a bit lonely and random

where the product name gets the title: product
the attritubes get their names as a title eg. Size, Colour.
Stock levels get the title In stock

and lastly how do i modify the length of my columns?

many thanks in advance, you are my favourite genius for the week!

ruby
www.productionkit.co.za



Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 19, 2006, 13:22:08 pm
ok i found more or less where to modify the width of the columns I am however just struggling slightly to modify the width of the Quantity column in particular, it's way to wide!!!

thanks again
Ruby
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 19, 2006, 14:13:24 pm
ok i found more or less where to modify the width of the columns I am however just struggling slightly to modify the width of the Quantity column in particular, it's way to wide!!!

thanks again
Ruby

Start ing at line 344 in classes/ps_product.attribute.php

      if (USE_AS_CATALOGUE != '1') {
                        $columns++;
                        $html.="<td width=\"12%\" align=\"right\">";

Hope this helps

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 19, 2006, 14:29:29 pm
Thanks for the tip above but unfortunately changing that value doesn't help but I pretty much figured out why so here goes.

Alright so I can see why I was having this width problem with the Quantity column  in the child list table. (Thank god for the developer toolbar in Firefox ey wot).

The add to cart button is sitting in the same table in the quantity column, I simply put the button in a new table directly under the child list table and my layout issues have now been solved.

I edited this in the In ps_product_attribute.php in line 377 by closing the first table and opening a new
like this:
$html .= "</table><table class=\"child_list\" width=100% align=\"left\">

voila! problem solved.

So after doing this editing the value you referrenced above does work.

so now i'm just holding out for those column headings and i'm one happy camper.

ruby
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 19, 2006, 15:46:32 pm
Please check this page something wierd is going on.

For one of my items I have 28 (eek i know) possible combinations, I have added them sequentially in the order I want them and I have also named them logically option A, option B, option C, etc so they appear in the order I want them too.

However having reached J it now orders itself under A which from a customers perspective makes no logical sense, although in my item list in the backend, they are appearing in the right order.

http://www.productionkit.co.za/index.php?page=shop.product_details&flypage=shop.flypage&product_id=63&category_id=11&manufacturer_id=0&option=com_virtuemart&Itemid=27

please check out my link and let me know if you have any ideas, I'm desperate to launch this site a.s.a.p so any help would be appreciated.

Thanks again.
ruby
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 19, 2006, 23:17:36 pm
Hi rub3licious

never had that happen before.

if you chnage this code in ps_product.attribute.php at line 233


      // Get list of children
      $q = "SELECT product_id,product_name,product_parent_id FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y' ORDER BY product_id";
      $db->setQuery($q);
      $db->query();
       
      if( $db->num_rows() < 1 ) {
         // Try to Get list of sisters & brothers
         $q = "SELECT product_parent_id FROM #__{vm}_product WHERE product_id='$product_id'";
         $db->setQuery($q);
         $db->query();
         $child_id = $product_id;
         $product_id = $db->f("product_parent_id")!="0" ? $db->f("product_parent_id") : $product_id;
            $parent_id= $db->f("product_parent_id");
         $q = "SELECT product_id,product_name,product_parent_id FROM #__{vm}_product WHERE product_parent_id='".$db->f("product_parent_id")."' AND product_parent_id<>0 AND product_publish='Y' ORDER BY product_id";
         $db->setQuery($q);
         $db->query();
           
      }


add the code in red to make the changes, you could also change it to product_name instead of product_id to sort by ... product_name!!!!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 20, 2006, 09:22:54 am
eureka!!!! thanks VERY much! :)

So the last thing that I would love to be able to have are column headings for the child lists,

eg. Product, Attribute Name, In Stock, Price.

I tried adding this myself but somehow managed to break everything! will keep trying and if I get it right i'll post it here if not I would appreciate it if u could help me!

Thanks for everything Mark
Ruby

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 20, 2006, 22:20:43 pm
eureka!!!! thanks VERY much! :)

So the last thing that I would love to be able to have are column headings for the child lists,

eg. Product, Attribute Name, In Stock, Price.

I tried adding this myself but somehow managed to break everything! will keep trying and if I get it right i'll post it here if not I would appreciate it if u could help me!

Thanks for everything Mark
Ruby



Hi Ruby

I have completed a modification to show Headers

in ps_product.attribute.php

after line 264

                // Start row for this child

insert this code

                // Show Header row
                if($ci == 0) {
                    $html .= "<tr><th>Description</th>";
                    $q = "SELECT product_id, attribute_name FROM #__{vm}_product_attribute_sku ";
                $q .= "WHERE product_id='$product_id' ORDER BY attribute_list ASC";
                $db_sku->setQuery($q);  $db_sku->query();
                while ($db_sku->next_record()) {
                   $q = "SELECT attribute_name ";
                   $q .= "FROM #__{vm}_product_attribute WHERE ";
                   $q .= "product_id='" . $db->f("product_id") . "' AND ";
                   $q .= "attribute_name='" . $db_sku->f("attribute_name") . "'";
                   $db_item->setQuery($q);  $db_item->query();
                   while ($db_item->next_record()) {
                      $html .=  "<th >";
                      $html .= " " . $db_item->f("attribute_name") . "</th>";
                   }
                }
                    $html .= "<th>Price</th><th>Quantity</th></tr>";
                }
                // End show Header Row

You can obviously alter the standard headings between the <th> and </th> accept the one $db_item->f("attribute_name") this picks up the attribute names from the database.

Hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 21, 2006, 14:44:41 pm
MARK U ARE A STAR!

Once again worked perfectly.

I truly appreciate the time you took to help me out with this.

I strongly believe that everything you have done here should be fully incorporated into the next release of Virtuemart.

Very Well Done!

Now my site does exactly what I want it to do! Thanks again!

Ruby
http://www.productionkit.co.za
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 21, 2006, 22:48:15 pm
Hi I have a little query. The mod looks great and will hopefully meet my needs. But is it possible to have a series of boxes where you enter the quantity required and one checkout button? Something like this site http://www.event-shirts.co.uk/design_your_own_t-shirt.php?oscsid=b43e49fd8bd2e64749a54cd31b6b48ee on the bottom right you can select small mediam large etc and then click the button to add to cart.

Dave :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 22, 2006, 00:24:32 am
Well I have sinced realised that can be done and have started to arrange the cart. Now as I am using it for clothes with sizes and colours I need to sort the layout order. Ie I have small, medium, large etc. At the moment it list in alphabetical order ideally I need small then medium and so on.

Any suggestions


Dave  ???
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: jjk on August 22, 2006, 13:43:29 pm
Hi Mark,

I still have empty cells in my "Add to Cart" table. If there is no child product, the cell shows the product unit, i.e. "piece". If there is one child product, there are two empty cells, if there are two child products, I get three empty cells between the product name and the product price in the table. Is it possible, that this is related to the VM language file? I noticed that this cell is not updated when I change languages. Normally I have everything set to german language.

Perhaps you can let me know what you changed in the original language file and I can translate and add these changes to the vM german language file.

Best Regards

Joerg
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: mark R on August 22, 2006, 14:37:55 pm
fantastic addition. to virtuemart

I have installed mod 106-1 works great, but is it possible to remove add to cart from the child list, for customers not logged in.  as i only allow prices etc to logged in users.  or completely remove the List/attributes for users not logged in.

thanks in advance
mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 22, 2006, 19:47:41 pm
Hi Mark,

I still have empty cells in my "Add to Cart" table. If there is no child product, the cell shows the product unit, i.e. "piece". If there is one child product, there are two empty cells, if there are two child products, I get three empty cells between the product name and the product price in the table. Is it possible, that this is related to the VM language file? I noticed that this cell is not updated when I change languages. Normally I have everything set to german language.

Perhaps you can let me know what you changed in the original language file and I can translate and add these changes to the vM german language file.

Best Regards

Joerg


JJk

the cells being displayed are the child attributes which are set when you create the child products i.e. size or colour or type etc

when you create a child product these items are entered at the bottom of the second tab - Item Status

see the included screenshots.

The only thing I can think of is that you have not entered any values for these and are just showing as blank.

Mark



[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 22, 2006, 20:14:34 pm
fantastic addition. to virtuemart

I have installed mod 106-1 works great, but is it possible to remove add to cart from the child list, for customers not logged in.  as i only allow prices etc to logged in users.  or completely remove the List/attributes for users not logged in.

thanks in advance
mark

Don't know what happened there, I normally check to make sure thats working correctly.

Anyway have modified the files and this should sort out the problems

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: mark R on August 22, 2006, 20:48:06 pm
Mark

Thanks for the new release. 106-2 , unfortunatly there is still a problem with the product details page.
when a product has no child products the order quantity is still visible ??

thanks again
mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: jjk on August 22, 2006, 21:13:15 pm
The only thing I can think of is that you have not entered any values for these and are just showing as blank.

Mark


Hi Mark,

Good guess!!! ;D
I never had the idea to scroll down below the grey box on that tab when entering data for a child product because there are no data entry fields when entering data for the parent product.

Many Thanks again!

Joerg
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 22, 2006, 21:52:12 pm
Well I have installed the updates but have a bit of a problem see below.

I am currently working on a site and have changed in the backend the flypages. The problem I appear to be having is this. If I go into a catergory (Only 1 has a product in at the mo) and click the add to cart button it returns to index.php and shows the wrong flypage. Not sure at all what is going on there.

I have one product on the site with 3 related ones, small, medium and large. If I add say 10 large to the cart it then goes to the wrong flypage. Pop on a try adding to cart and you will get the idea. It's drivng me mad!! Not sure if this is related to the mod or a problem in Virtuemart itself.

www.basic-box.co.uk/cms (http://www.basic-box.co.uk/cms)
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mark R on August 22, 2006, 22:02:08 pm
Davec,

have you fixed it??   i have just had a look at your site and it seems to be working ok..  you might want to try clearing your browser cache.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 23, 2006, 00:04:58 am
Mark

Thanks for the new release. 106-2 , unfortunatly there is still a problem with the product details page.
when a product has no child products the order quantity is still visible ??

thanks again
mark

Sorry about that!!!

change html/shop.product_details.php line 391 from

        if(USE_AS_CATALOGUE != 1) {

to

        if(USE_AS_CATALOGUE != 1 && $_SESSION['auth']['show_prices']) {

this will fix the problem

Well I have installed the updates but have a bit of a problem see below.

I am currently working on a site and have changed in the backend the flypages. The problem I appear to be having is this. If I go into a catergory (Only 1 has a product in at the mo) and click the add to cart button it returns to index.php and shows the wrong flypage. Not sure at all what is going on there.

I have one product on the site with 3 related ones, small, medium and large. If I add say 10 large to the cart it then goes to the wrong flypage. Pop on a try adding to cart and you will get the idea. It's drivng me mad!! Not sure if this is related to the mod or a problem in Virtuemart itself.

www.basic-box.co.uk/cms (http://www.basic-box.co.uk/cms)

same as mark r's reply. Checkedout the site and it is working correctly. I tried the Hooded jumper and it added to the cart correctly.

Hope this all helps
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 23, 2006, 09:09:28 am
 :-\ Can't believe I didn't clear cache first DOH! That is the first thing I do as a rule when someone tells me they can't see a new page. To many late nights I think.

Now when you go to the cart after adding products it shows the attribute HJ as I added no text it shows 2 brackets. Is there a way to hide or remove that the atributes in the page.

Oh and if you thought front page with cats on looked bad, it is far from finished and I have some sorting to do  ;D

Dave

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on August 30, 2006, 11:18:17 am
Hi Mark,

I need an option for clients where:

(My silly little algorithm for it)

If product_in_stock > 1 then
        display  Add to Cart
else
        display request stock

(yes i am aware it's a million times more complicated than that)

I know this isn't related in any way to your module, but my issue is this:
Now that I have applied your MOD to my site I need to know where this code will have to be inserted relevant to your MOD.

My guess is in:
ps_product_attribute.php

Around line 394 where this code is found:
// Add button for Add to Cart
           
            $columns--;
            if (USE_AS_CATALOGUE != '1') {
            //print($_SESSION['auth']['show_prices'] );
            $colcount += $columns;

My concern is that I only have the one "add to cart" button at the bottom of my table list of children, so in a scenario where at least one of the children has stock and at least one doesn't I guess I would then need two buttons at the bottom, one for "add to cart" and a second one for "request stock".

And then not related to your mod in:
shop.product_details.php

Do you think there is any other file I should need to modify too?

Seeing as I don't allow customers to add to cart when they are not in the details of the product itself I think that would be it.

Any advice you could give me here would be VERY much appreciated.

The idea behind this is that if an item is out of stock, instead of simply being notified when it comes back into stock the "request stock" button would then grab the productID and quantity requested and send an email off to the administrator (cc'd to the user) requesting it to be ordered in. And then notify can still be used to inform the customer that it has arrived.

I know you are, obviously, a very busy guy but in terms of feedback and assistance on this forum you have been a shining star. Even if you could just point me in the right direction I would really greatly appreciate it, if you are (like all of us) stripped for time and cannot help then thanks anyway for everything else you've done.

Much appreciated.
Ruby
http://www.productionkit.co.za


Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 30, 2006, 15:02:04 pm
An earlier version of my mod had multiple buttons, this could work - check back through the forum.

Another way is to alter ps_cart.php, check for 0 stock and send an email and continue the loop to check for the next item to be added, requested.

I have altered ps_cart to check multiple product_id's and this loops through, somewhere there it checks for 0 stock and redirects the page.

This would not alter the wording on the button, but it would be only 1 file to alter and it would cater for all situations.

Mark

Edit

If you check out this post

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=17143.0

You'll find a mod to send emails requesting product info, you could use this to base your enquiry system on.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 30, 2006, 19:20:15 pm
Ruby,

If you edit ps-cart and replace function add with this one

   /**
    * adds an item to the shopping cart
    * @author pablo
    * @param array $d
    */
   function add(&$d) {
      global $sess, $VM_LANG, $cart, $option, $vmLogger;

      include_class("product");
       
      $Itemid = mosgetparam($_REQUEST, "Itemid", null);
      $db = new ps_DB;
        $ci = 0;
        $request_stock = "";
      $_SESSION['last_page'] = "shop.product_details";
        //print_r($d);print_r($_SESSION['referer']);
        //Iterate through the prod_id's
        if (!isset($d["prod_id"]))
            return true;
        for ($ikey = 0; $ikey < sizeof($d["prod_id"]); $ikey++) {
       
            // Create single array from multi array
            $key_fields=array_keys($d);
            foreach($key_fields as $key) {
                if(is_array($d[$key]))
                    $e[$key] = @$d[$key][$ikey];
                else
                    $e[$key] = $d[$key];
               
                //$e[$key] = isset($d[$key][$ikey]) ? $d[$key][$ikey] : $d[$key];
                //print $key." ".$d[$key][$ikey]."<br>";               
            }
           
           $e['product_id'] = $d['product_id'];
            $e['Itemdid'] = $d['Itemid'];
            // Standard ps_cart.php with $d changed to $e
            $product_id = $e["prod_id"];
           
           
            $quantity = isset($e["quantity"]) ? $e["quantity"] : 0;
          //print $quantity;

          // Check for negative quantity
          if ($quantity < 0) {
             $vmLogger->warning( $VM_LANG->_PHPSHOP_CART_ERROR_NO_NEGATIVE );
             return False;
          }

          if (!ereg("^[0-9]*$", $quantity)) {
             $vmLogger->warning( $VM_LANG->_PHPSHOP_CART_ERROR_NO_VALID_QUANTITY );
             return False;
          }

          // Check to see if checking stock quantity
          if (CHECK_STOCK) {
             $q = "SELECT product_in_stock ";
             $q .= "FROM #__{vm}_product where product_id='$product_id'";
             $db->query($q);
             $db->next_record();
             $product_in_stock = $db->f("product_in_stock");
             if (empty($product_in_stock)) {
                $product_in_stock = 0;
             }
             if ($quantity > $product_in_stock) {
                //$msg = $VM_LANG->_PHPSHOP_CART_STOCK_1;
                //eval( "\$msg .= \"".$VM_LANG->_PHPSHOP_CART_STOCK_2."\";" );
                //$vmLogger->tip( $msg );
                //$GLOBALS['page'] = 'shop.waiting_list';
                //return true;
                    $request_stock[$ci]['product_id'] = $product_id;
                    $request_stock[$ci]['quantity'] = $quantity;
                    $ci++;
                    continue;
             }
          }

          // Quick add of item
          $q = "SELECT product_id FROM #__{vm}_product WHERE ";
          $q .= "product_parent_id = '".$product_id."'";
          $db->query ( $q );

          if ( $db->num_rows()) {
             $vmLogger->tip( $VM_LANG->_PHPSHOP_CART_SELECT_ITEM );
             return false;
          }

          // If no quantity sent them assume 1
          if ($quantity == "")
          $quantity = 1;


          // Check to see if we already have it
          $updated = 0;
      
          $result = ps_product_attribute::cartGetAttributes( $e);
       
          if ( ($result["attribute_given"] == false && !empty( $result["advanced_attribute_list"] ))
          || ($result["custom_attribute_given"] == false && !empty( $result["custom_attribute_list"] )) ) {
             $_REQUEST['flypage'] = ps_product::get_flypage($product_id);
             $GLOBALS['page'] = 'shop.product_details';
             $vmLogger->tip( $VM_LANG->_PHPSHOP_CART_SELECT_ITEM );
             return true;
          }

          // Check for duplicate and do not add to current quantity
          for ($i=0;$i<$_SESSION["cart"]["idx"];$i++) {
             // modified for advanced attributes
             if ($_SESSION['cart'][$i]["product_id"] == $product_id
             &&
             $_SESSION['cart'][$i]["description"] == $e["description"]
             ) {
                $updated = 1;
             }
          }
          // If we did not update then add the item
          if ((!$updated) && ($quantity)){

             $k = $_SESSION['cart']["idx"];

             $_SESSION['cart'][$k]["quantity"] = $quantity;
             $_SESSION['cart'][$k]["product_id"] = $product_id;
                $_SESSION['cart'][$k]["parent_id"] = $e["product_id"];
             // added for the advanced attribute modification
             $_SESSION['cart'][$k]["description"] = $e["description"];
             $_SESSION['cart']["idx"]++;
          }
          else {
             $this->update( $e );
          }

          /* next 3 lines added by Erich for coupon code */
          /* if the cart was updated we gotta update any coupon discounts to avoid ppl getting free stuff */
          if( !empty( $_SESSION['coupon_discount'] )) {
             // Update the Coupon Discount !!
             $_POST['do_coupon'] = 'yes';
          }
        } // End Iteration through Prod id's
      $cart = $_SESSION['cart'];
       
        // Added to allow iteration through request_stock array
        if (@$request_stock) {
            foreach($request_stock as $request) {
                print "Product id:".$request['product_id']." Quantity Ordered:".$request['quantity']."<br>";
                // You should change the above line to call a function to send emails
                // e.g. ps_request->request_stock_email($request['product_id'],$request['quantity']);
                // you could include a vmlogger tip function  in this to display a message to the user such as
                // $vmLogger->tip( "Stock request of ".$request['quantity'])." items requested for Product ".$request['product_id']) );
                //
            }
        }
        // End of modification
      return True;
   }

I've marked the changes in red and given some tips, hope this helps you out.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 30, 2006, 19:57:58 pm
I was wondering how rub3licious achieved the look for the page with flourescent tape on. This is ideally what I would like to achieve for the site I am creating to sell tee shirts, sweat shirts etc...

Advice very much appreciated

Dave  ;D
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: macallf on August 31, 2006, 00:30:16 am
Davec

which part of the page??

more specific info required

I'll do what I can to help.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: Davec on August 31, 2006, 09:08:39 am
Sorry Mark should have been a bit more specific  ???

It is the part where there is Option A Option B etc. followed by size colour and price qty then the add to cart button.  http://www.productionkit.co.za/index.php?page=shop.product_details&flypage=shop.flypage&product_id=82&category_id=11&manufacturer_id=0&option=com_virtuemart&Itemid=27

I must admit my original idea was something similar to this page http://www.event-shirts.co.uk/design_your_own_t-shirt.php?oscsid=d2024b53f90ee33d9c330d1cdeb76f15 again only the add to Basket part as such where there is S, M, L and you add the quantity you require. I may be wrong but I think it may involve alot of work to sort.

Dave   ;D
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on September 01, 2006, 13:37:31 pm
Hi Mark, DaveC

Wow, I 'm almost speechless, was off line for a day or two and now i'm in the habit of checking this MOD to see what's new and yeah, was so surprised to see all the fantastic stuff u put up here for me re stock requests!, just had a quick read through will go ahead and implement it now and we can see how it goes.

Thanks again Mark u have no idea what an awesome help u have been to me over the last few weeks!@#@!

DaveC: With regards to the look of the fluorescent tape page if you are only talking about the child list then... i installed Macallf's latest v1.0.6 mod and gradually tweaked it to include:
headings,
attributes,
stock levels,
only one add to cart button,
played around with the table column lengths
and now i'm busy finalising it with the add to cart changing to out of stock when 0 stock is in.

To create those various options ( eg size, colour) you need to become familiar with creating attributes and items, if you are not already. The basic concept is a parent product with children. All the information you need is on this post, as everything I achieved was done with Macallf's help. But it's quite simple:
first you create your parent product. then you add whatever attributes it needs, eg size, colour.
then you click on that parent product and begin creating items which are like children of that product, this is where option A, B, C comes in. All this is done in the product list section using the top menu.

If you search the forums there is a decent tut on that somewhere.

If you have any more specific questions once u've tried to do it then I will gladly help out where I can but it must be said that the genius around here is mark by a long shot!

Thanks again mark, good luck davec

Rube
http://www.productionkit.co.za
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 02, 2006, 21:45:49 pm
Hi all,

J! 1.0.11 VM 1.06

I have made quite a major modification to how this mod works which has enabled a system wide modification of the quantity box.

This means for any product in the store you can set how the quantity box is displyed.


The screenshot should explain this. Downloadable products are automatically set to checkbox. You can not set hide when using the list box and one addtocart button.( Will update this soon so that you can also have an addtocart button per child product)

You can now also decide if you require a table header displayed for child products.

This mod also corrects a problem with discounts. If a discount was added for a parent this was not reflected in the children. The mod now checks for discount in the children, if none is found it checks the parent.
This problem was inherent in the core VM, this also sorts it out for the standard dropdown.

I decided to add an extra tab to the add/modify product screen, as here are now so many options.
This is backwards compatible with previous mods and there are no database changes.

any problems please post.

Enjoy

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 03, 2006, 00:43:57 am
Hi All,

I've just got a working version of the multiple addtocart buttons working and have attached the files.

Consider this a BETA version. I havenot had time to fully test the multiple addtocart functionality, but I believe it is working fine.

The screen shots show the differences between the two methods.

Let me know how you get on.

Mark



[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 03, 2006, 15:49:26 pm
Hi All,

I think now the last part of the mod is in place.

It occured to me that when ordering multiple products there is a possibility of ordering more than 1 out of stock item.

The system at present just exists the addtocart routine and shows you a screen asking if you wish to be notified.

I've now modified this so that it builds a list of products, when all products have been added it then shows you the notify screen with all out of stock items listed. You can check those you wish to be notified of then continue as normal.
(see screenshot)

2 extra files had to be modified and these are included in the attached zip.( This is the complete mod)

If you have any problems or can think of any improvements, please let me know.

Another oddity is that you can define different quantity boxes for child products in a list!!!
So I've added another field called Use Parent Settings If this is checked it will use the parent product settings for the children. If unset you can define the childrens quantity field individually.

Mark.


[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 11:38:23 am
Hi All,

yet another release!!!

I have not found any other inconsitencies or problems.

If you have, please let me know.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 06, 2006, 16:43:15 pm
Well Mark you are the man no doubt about that!

Just one query really, something I need to get straight in my own mind. I have a design for some clothing. With that design there may be T Shirts, Sweats, Hooded jackets etc. Am I right to say that these can be assigned as product types for a design? Then I can add an attribute for each product type, ie Colour, Size etc? With size for instance there is small, medium, large etc can these all be added so they display individually within the size attribute!

Dave  ???
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 17:07:00 pm
It depends,

If you mean you have a product_type of design

then you could have advanced attributes for size & colour - although using this method you have no stock control per item .i.e. you have 100 t-shirts but then no idea how many of each colour and size.

But you can assign multiple product_types so you would create a parent of this design and add product_type attributes of type, size and colour.

It does mean creating a lot of child products, but you get the full functionality.

The included screenshot should explain, each product has a colour and size product_type, the last one has a colour of red, the same as the first, but the size is medium not small

I hope that explains it!!

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 06, 2006, 17:29:43 pm
I think I get it  ???

What I have is a design for clothing. So are the product types T shirt, Sweat Shirt etc? I am not expecting stcok control using this method but do need to be clear before I launch into adding attributes etc. I do not want drop down boxes for the sizes, so they would all basically be displayed in tabular form similar to the rub3licious  site and the tapes



Dave  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 17:37:09 pm
In that case add them as product types

each product child would hen have several product types

see screenshot

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 17:46:05 pm
Just created a product with 3 attributes

Hope this screenshot shows what is possible



[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 06, 2006, 17:51:33 pm
So the product type is T-Shirt hoodie etc? Thanks for all your help with this.  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 17:56:23 pm
yeah, apart from where I've said product_type change that to attribute!!

Head still not in gear

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 06, 2006, 18:07:14 pm
My head must be in neutral then hahaha.......
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 06, 2006, 19:50:46 pm
Well seem to have got my head around that! Now have a second little problem. Products sort order. If you at the attachment you can see what I mean. I have Small, Medium, Large in white then it goes Small Black then Extra Large white. I would like to be able to keep colours and sizes in order. Is it possible?

Dave  ;D

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 06, 2006, 20:36:48 pm
It's normally ordered by product_id, so the list comes out in the order they were added. They could be ordered in a different fashion, say by product_sku - but you would have to assign the sku correctly e.g. design1-tshirt-white-0 where 0 would be for small 1 for medium etc.

If thats what you want I'll post the modification you need to make
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 07, 2006, 09:01:53 am
Thanks for the reply. Odd as it may seem the Extra Large in white was the last product to be added but as you can see it is not the last on the list. I will have a thought and a chat with my client as it is quite clear to me that the list will be very long in it's current format with the various types of top and sizes.

Dave  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 09, 2006, 00:54:49 am
Hi All another update

this one adds an extra variable to the global configuration screen (see screenshot)

After you have over-written the files, go into the admin configuration screen. You will see an error message but this is because the variable has yet to be defined. Save the configuration to define the variable and then you can either set or unset the variable.

This just asks if you want the user to go to the cart when they addtocart - default action or selected - user stays on the page they are on when you press addtocart.

Mark



[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 09, 2006, 12:43:24 pm
Right this is ideally what my customer is looking for! As per the site below. But where is says Men's Sizes it would say Tee Shirt. So I would have one table with Teeshirts then another with Long Sleeve Tee's then another would say Hooded Tops for instance. The colours as per the site would be on the left with multiple quantity boxes so the customer can add the quantities. This would allow the cutomer to order the required quantities and colours for each design. Hope this makes sense  :P

It appears they have the add to cart form repeated twice. I would possibly need it 6 times for some products.

http://www.planett.com.au/index.php?page=shop.product_details&flypage=shop.flypage&product_id=3370&category_id=99&option=com_phpshop&Itemid=1

Dave
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 09, 2006, 12:58:44 pm
Looks nice davec,

but would require a lot of modification to the mod to achieve an output like that.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 09, 2006, 13:14:14 pm
So is are you or anyone else able to take it on? This is so much what I am looking for!!!  ???

Dave
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 09, 2006, 13:19:22 pm
I could take it on.

But paid work comes first!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 09, 2006, 13:23:18 pm
Ok, well wasn't expecting this for free but would be very happy if you could provide me with a price and timescale so I may then speak with my client.

Dave  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Davec on September 09, 2006, 15:24:49 pm
Mark this is the look I require couldn't add an image in the messages

Dave

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
Post by: rub3licious on September 13, 2006, 14:24:42 pm
Hey Again Mark,

I have tried to do this request stock modification on my own in my own way now. I try to use the existing shop.waiting_list.php, shop.waiting_thanks.php and zw_waiting_list.php to achieve this by writing a notifyAdmin function and calling it when a user clicks on the Notify Me! Button, however I'm not winning although I feel like i'm so close to getting it done.

I would appreciate it if you could take a gander at what I've done and see if perhaps I've missed the plot somewhere.

Here is a link to the modified files:

http://www.productionkit.co.za/ruby/stockRequest.zip

Note my function in zw_waiting_list.php starting at line 209. The real issue is I guess where and how should I call it, I think that's what I'm strugling with, assuming there isn't mistakes in the code itself.

Tar Muchly!
Rube
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 13, 2006, 14:30:39 pm
Hi Ruby

have you looked at my latest update. This uses a multiple notify routine altering the files toy are dealing with.

This may give you more idea

Mark.

(ps i dont which childlist mod youre using, there was a big update that handles multiple outofstock requests at once the changes are in ps_cart, shop.waiting_list and zm_waiting_list)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: rub3licious on September 13, 2006, 14:36:15 pm
yeah I noticed you made some massive updates since I was last here, I customized your mod so much on my own that I'm a bit scared to update to your latest one as I will probably lose a lot of hacks I made myself.

any chance you'd consider adding the stock request functionality to your latest update? is there anyone else out there that thinks it's useful?

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Bruce Morgan on September 14, 2006, 17:09:51 pm
I enquired about this mode a few months agp and someone was patient enough to explain it to me so I downloaded the file.  I was ready to install it a short time later and there were another half dozen updates and at least two different versions.  I am very interested in using this but my question is whether this mod is ready to use or just part of a perpetual hack experiment?  Rather than browsing through 11 pages or posts could soimeone just give a summmary of what the module does, how it is installed and known issues or remaining work tobe done?

Bruce
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 14, 2006, 17:46:43 pm
It's a full and working mod

Hopefully it will be included as standard in VM1.1

The updates are normally for VM core updates, we're now at VM 1.0.7, so I'll have to make sure that it works with this update and post new files.

So many peolple asked for different variations so I have made a version that should cater for everyone.


I hope this explains what is going on. As far as I am aware nobody is having problems using this

I hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kaputtendorf_fred on September 21, 2006, 10:18:46 am
Hi Mark!

Do you have a release date for your updated files? I'm working on a new shop based on vm1.0.7 and want to use your great mod. I tried to get it work with childlist1.0.6 but it doesnt work.

Tim
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 21, 2006, 14:36:32 pm
I lied

new files for 1.0.7 attached

the only difference I could find is that the new release adds to cart rather than updates cart. This update checks for multiple items being added and changes the cartadd to cartupdate in this instance.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kaputtendorf_fred on September 21, 2006, 17:37:18 pm
hmm.. i installed a joomla1.0.11+vm1.0.7-ecommerce-package and replaced the original files with this i got from your package. but every time i got the same error:

Quote
Parse error: syntax error, unexpected '{' in /www/xxx/shop/administrator/components/com_virtuemart/html/shop.product_details.php on line 472

what can i do to get it work?

thx for help (and fast relaese :-) )!

tim
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 21, 2006, 17:44:56 pm
attach your shop.product_details file


I dont think it overwrote correctly.

Have just installed the package on a vanilla install and no problems

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 21, 2006, 18:04:44 pm
Just notice d that I missed a line from product.product_form.php

at line 78 add this code

$display_label = $VM_LANG->_PHPSHOP_PRODUCT_FORM_ITEM_DISPLAY_LBL;

It just displays the display option value in the product form

Mark



Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kaputtendorf_fred on September 21, 2006, 21:53:25 pm
oh. i'm sorry. you were right.
there was anywhere a problem during the file-replacement. i had to delete the original files first.
it seems that it works now.

thx!

tim
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: jjk on September 23, 2006, 09:42:29 am
Hi,
Just a note - I changed to Virtuemart 1.07 last week and overwrote it with version 1.06 of Mark's hack again without having any problem - just works fine. ;D

Joerg
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: mark R on September 25, 2006, 14:16:15 pm
Mark,

Fantastic Mod..(would be nice to have it as standard)

Installed it on 1.07 Works a treat.

Just one thing.... how do i change the coloumn width of the Description in the child list

Edit....    Child list does not show discounted price????!!!!????

thanks again
mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 25, 2006, 14:48:12 pm
Hi,

child list in dropdown does not show discounted price. Not even in single product items is the price shown with discount applied!!!!

The price tag does show the discounted price but with children with multiple prices this obviously doesn't work.

If the link to child product is enabled you can display single child products and this will display the discounted price in the price field.

If, however, you wish to show the actual price in the child list. Edit ps_product_attribute.php at about line 336 you'll find

            // Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }

edit this to this

            // Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_adjusted_attribute_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }

and at line 536 change

            // Now get item price if not catalogue and show prices enabled
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                    }
                    //$columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }

to

            // Now get item price if not catalogue and show prices enabled
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_adjusted_attribute_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                    }
                    //$columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }

the code marked in red is the changed code. This will show the discounted price for child products.

line 293 for one add to cart button and line 495 for multiple add to cart buttons are where the width for the product name are set.

I hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mark R on September 26, 2006, 13:08:32 pm
Is it possible to sort child list by SKU ??
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 26, 2006, 13:16:04 pm
Check this post and change product_id to product_sku, the line numbers mayhave changed but the code hasn.t

http://virtuemart.net/index.php?option=com_smf&Itemid=71&option=com_smf&Itemid=71&topic=15697.msg51683#msg51683 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&option=com_smf&Itemid=71&topic=15697.msg51683#msg51683)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: maddunr on September 26, 2006, 22:43:10 pm
Hi,

Thanks for the amazing mod Mark! I have a two questions:

1. Is there a global way all products can be set to show items in a list? Currently, I have to go to each product's admin page to set options in "Display Options".

2. Can additional parameters (like thumbnail image, short description etc.) be displayed in the list?

Thanks,
V
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 26, 2006, 23:08:13 pm
Hi V,

you can alter the default settings in product.product_form.php for which items are set as default for newly created products, you can't however do this for products already created unless you ran a query down the product_atrributes table to add or change the current settings.

You can alter the functions within ps_product_attribute to pull in additional fields. These are not generally required i.e. they are not included as standard.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: maddunr on September 27, 2006, 18:46:54 pm
Hi Mark,

Quote
unless you ran a query down the product_atrributes table to add or change the current settings.
Can you pls explain this a little bit more? I coulnd't see anything new in this table that would affect child list settings.

Thanks,
-V
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 27, 2006, 19:27:43 pm
When you add a new product with the mod installed certain values are added to jos_vm_product_attributes

product_list             null or N - drop down - Y - Child List - YM - Child list multiple add to cart
product_list_child     null or N - dont link to children, Y - Link to Children
vm_use_parent          "         - dont use parent settings, Y - use parent settings
vm_list_header           "         - dont display table header, Y - display table header
vm_quantity_box        "        I can't remeber the setings offhand

if these aren't set display as normal, if they are do what they say.

You would have to check your product_id with the product_id in product_attribute, if it didn'e exists write out the attributes you want to the table

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: maddunr on September 28, 2006, 23:13:03 pm
Hi Mark,

Thanks for the explanation. I do understand the additions to the table jos_vm_product_attribute now. However, I am seeing a different problem on my flypage now....

When a product doesn't have any child products, a table (with class "child_list") appears. I have given the class a red background just so you can see it. It shows the product's name / sku (both same in my case). See screenshot attached.

However, if a product has child items (and LIST has been checked in Display Options), then the table appears normally (no class applied to the table, but sectiontableentry1 and sectiontableentry2 applied to each row).

I suppose that the code that checks if a product has child items or not is missing from ps_product_attribute.php, but I am not entirely sure what's happening.

EDIT: I think it might be in shop.product_details.php

EDIT: I realize that this might be to show "add to cart" in a regular shopping cart. However, I use the "show as Catalogue" option. So, that extra table with just the product's name and no add-to-cart or prices (since both are off) is quite unnecessary. Should I just comment out the lines that call for this is shop.product_details.php?

Any ideas?
-V

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: thomas_freeman on September 29, 2006, 08:55:21 am
Earlier, macalf, you mentioned the discounted prices:
Quote
child list in dropdown does not show discounted price. Not even in single product items is the price shown with discount applied!!!!

The price tag does show the discounted price but with children with multiple prices this obviously doesn't work.

If the link to child product is enabled you can display single child products and this will display the discounted price in the price field.

If, however, you wish to show the actual price in the child list. Edit ps_product_attribute.php at about line 336 you'll find

I discovered you are right.  Ideally, I would love to have it mark out the actual price and then display the discounted price.  I see that this happens at the top of the page but down below it still lists it the same way.  I'm afraid this will be very confusing.  And it doesn't change the child list on the referring page at all.

You can see my page at: www.WarehouseHandlingEquipment.com (http://warehousehandlingequipment.com/component/page,shop.product_details/flypage,shop.flypage/category_id,/product_id,335/option,com_virtuemart/Itemid,32/)
It's not working on the child link or the child list.  Any ideas?  I'm running Joomla 1.11 and VM 1.07  I installed your 107-1 update from above.

Thanks for any help!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: thomas_freeman on September 29, 2006, 08:58:33 am
To the Moderators:
I would like to recommend that this 12 page thread become a folder in and of itself.  There is enough activity with this mod alone to warrant seperating out all of the discussion that is happening!  It's get's tough to follow at times.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 29, 2006, 18:00:26 pm
thomas_freeman

in an earlier post I discussed the code that needs to be changed to show the discounted price.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg55295#msg55295 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg55295#msg55295)

This does not display the strikeout full price but it does show the actual price.


the code could be altered to show both but it depends on how you want it displayed.

If you replaced this code in ps_product_attribute.php (about line 542 & 337

// Attributes for this item are done.
// Now get item price
      if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
             $price = $ps_product->get_price($db->f("product_id"));
         if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
            $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
            $price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }         
with this

// Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_price($db->f("product_id"));
                    $actual_price = $ps_product->get_adjusted_attribute_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                        $actual_price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= "<span style=\"color:red;\">\n<strike>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
                    $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"]);
                    $html .= "</td>";
                }                       

it will display the price as $xx.xx $xx.xx

Hope this helps             

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: thomas_freeman on September 29, 2006, 20:35:28 pm
Awesome, Thanks!  I really love virtuemart and the support available in this strong user following.  I will atempt to implement this and let you know how it goes!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: mark R on September 30, 2006, 11:45:19 am
Hi mark,

thanks for the pricing code, only thing is the line shows 2 prices at the same time, even if the product is not discounted, anyway of only displaying 2 prices only when a product has been discounted and 1 price if not discounted.?

thanks
mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: gizmoidea on September 30, 2006, 12:09:50 pm
Hi Mark,

Thank you for the modification. I've installed the childList107-1 version with my newly installed 1.07 vm with joomla 1.0.11 but i discovered that when i press "add to cart" in the product scroller & latest product. the product doesn't add to cart and just go directly to show the cart content only. Are there anything i need to modify before it can use?

Thanks,
Edward
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on September 30, 2006, 17:39:26 pm
Hi Mark,

Thank you for the modification. I've installed the childList107-1 version with my newly installed 1.07 vm with joomla 1.0.11 but i discovered that when i press "add to cart" in the product scroller & latest product. the product doesn't add to cart and just go directly to show the cart content only. Are there anything i need to modify before it can use?

Thanks,
Edward

Hi Edward

I have never tested the mod with these modules, hence the problem

There is only 1 file and 1 line to change

in ps_products.php change line 2323

$url = "?page=shop.cart&func=cartAdd&product_id=" .  $db->f("product_id");
   
to

$url = "?page=shop.cart&func=cartAdd&product_id=" .  $db->f("product_id")."&prod_id=" .  $db->f("product_id");
   
this adds the extra field to make the addtocart work with modules

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: gizmoidea on October 01, 2006, 08:48:40 am
Hi Mark,

Thanks for your information. I've edited the ps_product.php and now the product can add to cart. However, I discover another problem. I'm now using the sample data to test the website. When I press add to cart of "Drill", it added to cart but when i press the remove button in the cart, it cannot be removed. In addition, if I press add to cart of "Drill" twice at the lastest product, it will empty the cart. I found that this problem only occurred when product can directly add to cart. For other product which need to choose product attribute, it works fine.

Edward
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 01, 2006, 23:18:05 pm
Again you rdead right.

It's because the mods call the functions direct to add items to the cart, without going through the parser.

I've altered ps_products.php so that the snapshop function now calls a form which goes through the parser, this seems to be working fine, but I'd appreciate it if you would test some more just to be sure.

I've attached ps_products.php just overwrite the old ps_products

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: gizmoidea on October 03, 2006, 00:51:28 am
Hi Mark,

I've tested it and it's working fine now. Thank you very much.

Edward
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kaputtendorf_fred on October 03, 2006, 04:48:40 am
I've got another problem and i hope someone can help me with this:

in my shop i've got a child list with an add-to-cart-button for every child-product. and i want that he jumps to cart when i press "add-to-cart", but every time i got only the "Cart Updated - Added: 1 Product/s" information at the product-details page.

it makes no difference if i enable or disable the "Dont show cart on add to cart" option at the admin backend.

has anyone an idea how i can get work?

thx in advance!

tim
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 04, 2006, 00:40:45 am
kaputtendorf_fred

Sorry another one that I missed, have attached an updated ps_product_attribute.php

just extract and overwrite

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: baisan on October 05, 2006, 12:30:19 pm
hi there im having this quantity problem in IE and Firefox
when i add a quantity lets say 123456 (6) digit and it will
compute with the product price it is correct,
example:

Quantity | price
123456 x $5 = 617280

In IE the Quatity "123456" is show in the quantity field when you click the Add to cart button. But in Firefox instead 123456
it only show 1234 in Quantity field but the computation is correct. It confuses the customer/buyer.

Is this validation issue? quantity field issue?
crossbrowser issue?

Please HELP!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: baisan on October 06, 2006, 11:11:13 am
is there a way can i validate the quantity maximum of 6 or 10 digits only? because as i can see i can add qautity up to ulimited
number of digits.

Please help
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 06, 2006, 21:00:08 pm
The quantity field in VM is set up to display 4 digits. FF obeys these rules IE doesn't. You would hav to alter the form fields for quantity and change it's size in show_quantity_box in ps_product_attribute. it should be at line 978
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 06, 2006, 21:03:20 pm
is there a way can i validate the quantity maximum of 6 or 10 digits only? because as i can see i can add qautity up to ulimited
number of digits.

Please help

Yes you can, but I'm not going to. Reason, not everybody wants it or needs it. If the quantity is greater than you have in stock, then they don't get ordered. If you have the stock and somebody wants to but unlimited amounts - let them!!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mark R on October 12, 2006, 16:27:14 pm
thomas_freeman

in an earlier post I discussed the code that needs to be changed to show the discounted price.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg55295#msg55295 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg55295#msg55295)

This does not display the strikeout full price but it does show the actual price.


the code could be altered to show both but it depends on how you want it displayed.

If you replaced this code in ps_product_attribute.php (about line 542 & 337

// Attributes for this item are done.
// Now get item price
      if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
             $price = $ps_product->get_price($db->f("product_id"));
         if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
            $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
            $price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
                }         
with this

// Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
               $price = $ps_product->get_price($db->f("product_id"));
                    $actual_price = $ps_product->get_adjusted_attribute_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
                        $actual_price['product_price'] *= $tax_rate;
                    }
                    $columns++;
                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= "<span style=\"color:red;\">\n<strike>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
                    $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"]);
                    $html .= "</td>";
                }                       

it will display the price as $xx.xx $xx.xx

Hope this helps             

Mark

Thanks for above hack.

1 problem though when i have a product WITHOUT any child products it still show the full price where the child products are displayed on the product details page . any ideas?

thank
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Johnny33 on October 12, 2006, 18:07:53 pm
Hi
Thanks for a great mod.
If I understand this right, the child product's form gets automatically populated with the vendor and category fields, is it possible to automatically populate other field? In my case, I only need a different SKU and attribute on the child product. So that if I change the price in the parent poduct, the price in the child products would change as well.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 13, 2006, 23:17:38 pm
Hi
Thanks for a great mod.
If I understand this right, the child product's form gets automatically populated with the vendor and category fields, is it possible to automatically populate other field? In my case, I only need a different SKU and attribute on the child product. So that if I change the price in the parent poduct, the price in the child products would change as well.

The're automatically populated from the parent aswell, so are the images description etc. If they don't exist in the child the're taken from the parent.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: mark R on October 16, 2006, 17:32:31 pm
Mark,

Would it be possible to get the available QTY displaying on the child product list?

thanks in advance
mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: João Costa on October 17, 2006, 19:17:39 pm
Hello

Since this is my first post I have to thank everyone work and dedication. Virtuemart is really incredible.

I want to build a clothes store and this child products/attributes hack is really an essential part of it.
The perfect solution for my problem would be this one Davec requested about a month ago:

Mark this is the look I require couldn't add an image in the messages

Dave

I'm no PHP'er, I see however that he (or someone else) already managed to get the job done at this site:
http://www.planett.com.au/index.php?page=shop.product_details&flypage=shop.flypage&product_id=3370&category_id=99&option=com_phpshop&Itemid=1 (http://www.planett.com.au/index.php?page=shop.product_details&flypage=shop.flypage&product_id=3370&category_id=99&option=com_phpshop&Itemid=1)

Can the author please share his work with us?

Thanks

João
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: Boudewijn on October 19, 2006, 16:52:21 pm
First I want to say thanks for this fantastic mod.

Question, is there a up to date dutch language file for this mod?

Thanks
Boudewijn
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 20, 2006, 12:48:25 pm
Sorry, I don't speak dutch!! But if someone else has created one please share.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 20, 2006, 14:31:07 pm
Hello

As this is my first post, I would like to start of by thanking everyone for their contribution, especially macallf! I'm really impressed with your work on this mod!

At the moment I'm using Mark's 1.07 mod for the site I'm developing. I'm using the child list to display the tracks of a music album (parent). The mod works fine, but I would like to add some extra fields (such as tempo, genre, composer etc.) in the child list without having to click on the child item for more information. In this way when you click on an album, you get to see the album image& description on top with a detailed list of all the tracks.

Working with just a flypage I believe I know how to add the new columns in the database, edit the shop.product_details.php and edit the flypage to display the new fields. However, with this mod things seem to be quite a bit more complicated as the child list cannot be customized in the flypage. As my PHP skills are very limited, I'm not quite sure how to go about adding these fields in the child list.

Any help on the matter would greatly be appreciated! Perhaps if I someone could point me in the right direction I can figure out how to go about doing this...

Thanks in advance!!

Jesse
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: thomas_freeman on October 20, 2006, 14:49:50 pm
I recently did this using Product_Types.  I modified Mark's Mod to pull the Product_Type fields in and display them as a column.  I really believe there is a much greater need for this than people realize.  Seems like the Product_Types are very little understood or used.  I'm still waiting for help in populating the fields through CSV.

Take a look at:
http://www.WarehouseHandlingEquipment.com (http://warehousehandlingequipment.com/materials-handling-equipment-store/page,shop.product_details/flypage,shop.flypage/product_id,57/category_id,74/manufacturer_id,0/)

for an example.

I would be glad to share the changes with you but they are dirty at best.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 20, 2006, 15:17:42 pm
Thanks for your reply Thomas.

I took a look at your site and it looks good!

Perhaps using product types is the way to go. I'm reading up about them right now as I (like you mentioned) am not quite sure how to use them best.

Do you know if it would be possible to display the product types in the child list in rows as well? If I were to put all the information in columns the page would look very crammed i think.

As far as my logic goes, it would be great if were possible to layout an item in a childlist with a flypage. But to be honest, I have no idea if this possible as far as the programming is concerned.

I'ld definitely like to hear more about how what changes you made and perhaps others can share their thoughts as well?

Thanks again,

Jesse
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: thomas_freeman on October 20, 2006, 16:34:35 pm
Well, If you look at the current use of Product_Types, they are displayed in rows at the bottom of the page.  It comes down to replacing the <td> code in my modifications with <tr>.  Wouldn't be hard at all.

I will try to clean up my changes and post it.  It is closely tied to this mod, so I'm not sure if I should keep it in this "growing" thread or start a separate post.  I really wish there was a way to clearly indicate sub-threads within these threads.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 20, 2006, 16:46:39 pm
I appreciate your help!

I look forward to seeinig the changes you have made. It seems this could be the soloution I am looking for!

As far as this thread is concerned, I'm not sure If we should continue here either. On the other hand I can imagine others are interested in expanding this mod with extra fields.

Perhaps Mark can let us know as it is his thread and mod!

Thanks,

Jesse

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 20, 2006, 22:04:29 pm
JDA & thomas_freeman,

the best way I can see of using product type's with my mod is to set up a call to product types at the end of the child list loop within ps_product_attributes.php. This would allow product type info to be displayed with each child. Obviously using product.type flypages (which aren't flypages as with the rest of VM, they're extensions) would allow the output to be formatted as you like.

If you really need it I'll look into where it should be inserted in the code and will post the modifications. It shouldn't be that difficult.

As to setting up a separate thread for a mod to a mod I do not know if that's appropriate. I know someone has asked for this thread to be a child thread in its own right, again I don't know if its appropriate. But I will say that I am working on this mod to be integrated in VM 1.1

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 20, 2006, 22:45:58 pm
Hi Mark,

Thanks for your reply and thanks for a great mod!

If it is't to much trouble for you, I'ld really appreciate your help on this.

In my opinion it would be a great addition to be able to display the child product types.
For my situation it would be the perfect way to display all info on a music album and the individual tracks on one page. The next step for me would be to create an "audition" button which loads the product (child) download file in a mp3 player like wimpy. If I can get this all working I think this would be a great soloution for anyone selling music with VM.

I hope this mod becomes a part of VM 1.1! Thanks again for all the work you've done!

Jesse
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: thomas_freeman on October 21, 2006, 16:51:41 pm
Here is the code I used to create the columnar product type report.

First I added two functions to the ps_product_types.php
Quote
   /**************************************************************************
   ** name: listrow_product_type_element()
   ** created by: Thomas Freeman by modifying list_product_type
   ** description: Returns html code for show parameters
   ** parameters: product_id
   ** returns:
   ***************************************************************************/
   function listrow_product_type_element($product_id) {
      global $VM_LANG, $mosConfig_live_site;

      if (!$this->product_in_product_type($product_id)) {
         return "";
         }

      $dbag = new ps_DB;
      $dba = new ps_DB;
      $dbp = new ps_DB;
      $html = "";

      $q  = "SELECT * FROM #__{vm}_product_product_type_xref ";
      $q .= "LEFT JOIN #__{vm}_product_type USING (product_type_id) ";
      $q .= "WHERE product_id='$product_id' AND product_type_publish='Y' ";
      $q .= "ORDER BY product_type_list_order";
      $dbag->query( $q );
      $q  = "SELECT * FROM #__{vm}_product_type_parameter ";
      $q .= "WHERE product_type_id=";
      while ($dbag->next_record()) { // Show all Product Type

         // SELECT parameter value of product
         $q2  = "SELECT * FROM #__{vm}_product_type_".$dbag->f("product_type_id");
         $q2 .= " WHERE product_id='$product_id'";
         $dbp->query($q2);
         
         // SELECT parameter of Product Type
         $dba->query($q.$dbag->f("product_type_id")." ORDER BY parameter_list_order");
         $i=0;
         while ($dba->next_record()) {
            $html .= "<td style=\"text-align:center\" id=\"Product_Type_Element\">";
            $html .= $dbp->f($dba->f("parameter_name"))." ".$dba->f("parameter_unit");
         }
      }
      return $html;
   }
      
   /**************************************************************************
   ** name: listrow_product_type_heading()
   ** created by: Thomas Freeman by modifying list_product_type
   ** description: Returns html code for show parameters
   ** parameters: product_id
   ** returns:
   ***************************************************************************/
   function listrow_product_type_heading($product_id) {
      global $VM_LANG, $mosConfig_live_site;

      if (!$this->product_in_product_type($product_id)) {
         return "";
         }

      $dbag = new ps_DB;
      $dba = new ps_DB;
      $dbp = new ps_DB;
      $html = "";

      $q  = "SELECT * FROM #__{vm}_product_product_type_xref ";
      $q .= "LEFT JOIN #__{vm}_product_type USING (product_type_id) ";
      $q .= "WHERE product_id='$product_id' AND product_type_publish='Y' ";
      $q .= "ORDER BY product_type_list_order";
      $dbag->query( $q );
      $q  = "SELECT * FROM #__{vm}_product_type_parameter ";
      $q .= "WHERE product_type_id=";
      while ($dbag->next_record()) { // Show all Product Type

         // SELECT parameter value of product
         $q2  = "SELECT * FROM #__{vm}_product_type_".$dbag->f("product_type_id");
         $q2 .= " WHERE product_id='$product_id'";
         $dbp->query($q2);
         
         // SELECT parameter of Product Type
         $dba->query($q.$dbag->f("product_type_id")." ORDER BY parameter_list_order");
         $i=0;
         while ($dba->next_record()) {
            $html .= "<th style=\"text-align:center\" id=\"Product_Type_Heading\">";
            $html .= $dba->f("parameter_label")."</th>";
         }
      }
      return $html;
   }
Then I modified Mark's mod in ps_poduct_attribute.php.  First I added a call to load the ps_product_type.php file where I added the functions.
Quote
   function list_attribute_list_multiple($product_id) {

      global $VM_LANG, $CURRENCY_DISPLAY,$mm_action_url,$sess;
   
      require_once (CLASSPATH . 'ps_product.php' );
      $ps_product = new ps_product;
      
      /** Load important classes **/ 
      require_once(CLASSPATH . 'ps_product_type.php' );
      $ps_product_type = new ps_product_type;

Around line 488 I added a line to show headers before  finishing the price tag:
Quote
               /** Get Product Type Heading List **/ 
               $html .= $ps_product_type->listrow_product_type_heading($db->f("product_parent_id"));
               
                    $html .= "<th>Price</th>";
Around line 537 I added the following code before the attribute list code.
Quote
            /** Get Product Type Element List **/ 
            $html .= $ps_product_type->listrow_product_type_element($db->f("product_id"));

                // For each child get attribute values by looping through attribute list
            $q = "SELECT product_id, attribute_name FROM #__{vm}_product_attribute_sku ";
            $q .= "WHERE product_id='$product_id' ORDER BY attribute_list ASC";

This will cause the product_types to be listed in columns on your flypage.  However, be aware that the product_types will also display at the bottom of the page unless you remove that call from flypage layout.  Also, the headers are dependent on the parent object having the same product type.  This meant that I needed the flypage to display differently depending on if it is showing a parent or children.  I modified the shop.product_details.php to do this.  Around line 139 I added to lines to show if children are present:
Quote
/** Get the CATEGORY NAVIGATION **/
  $navigation_pathway = "";
  $navigation_childlist = "";
  $pathway_appended = false;
  /** PTMOD - show no children are present **/ 
  $children_present = false;
  if (empty($category_id))  {
  /** PTMOD - show children ARE present **/ 
     $children_present = true;
Then I modified the string replacements around line 465 to conditionally display the product_type Data:
Quote
/** NOW LET'S BEGIN AND FILL THE TEMPLATE **/
$template = str_replace( "{navigation_pathway}", $navigation_pathway, $template );
$template = str_replace( "{navigation_childlist}", $navigation_childlist, $template );
$template = str_replace( "{product_name}", $product_name, $template );
$template = str_replace( "{file_list}", $file_list, $template );
$template = str_replace( "{edit_link}", $edit_link, $template );
$template = str_replace( "{manufacturer_link}", $manufacturer_link, $template );
$template = str_replace( "{product_s_desc}", $db_product->f("product_s_desc"), $template );
$template = str_replace( "{product_description}", $product_description, $template );
$template = str_replace( "{product_weight}", $db_product->f("product_weight"), $template );
$template = str_replace( "{product_sku}", $db_product->f("product_sku"), $template );
$template = str_replace( "{addtocart}", $addtocart, $template );
$template = str_replace( "{product_reviews}", $product_reviews, $template );
$template = str_replace( "{product_reviewform}", $product_reviewform, $template );
$template = str_replace( "{product_availability}", $product_availability, $template );
$template = str_replace( "{vendor_link}", $vendor_link, $template );
$template = str_replace( "{mosConfig_live_site}", $mosConfig_live_site, $template );
$template = str_replace( "{related_products}", $related_product_html, $template );
$template = str_replace( "{product_packaging}", $product_packaging, $template ); // Changed Packaging

/** PTMOD - Only replace these if there are no children present. **/ 
if ($children_present != False){
   $template = str_replace( "{product_image}", "", $template );
   $template = str_replace( "{full_image}", $full_image, $template ); // to display the full image on flypage
   $template = str_replace( "{more_images}", $more_images, $template );
   $template = str_replace( "{product_price}", $product_price, $template );
   $template = str_replace( "{product_type}", $product_type, $template ); // Changed Product Type
   }
   else {
      $template = str_replace( "{product_image}", "", $template );
      $template = str_replace( "{full_image}", "", $template ); // to display the full image on flypage
      $template = str_replace( "{more_images}", "", $template );
      $template = str_replace( "{product_price}", "", $template );
      $template = str_replace( "{product_type}", "", $template ); // Changed Product Type
}


I know this is not the most elegant or cleanest code.  I would love to have someone clean it up and pass it on.

Enjoy!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 21, 2006, 20:37:05 pm
Thanks for sharing this! I added your code and all seems to work!

Now I will add the proper data and figure out how to display the info like I want it to. I will let you know how things progres!

As for the code, it is far more than I could have achieved! Hopefully someone is willing to take a closer look at it, it's definitly a great add on to this mod!

Thanks again,

Jesse
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: JDA on October 23, 2006, 19:29:30 pm
Having spent the better part of two days trying to display the child product type attributes as I would like, I still havn't made much progres...

In ps_product_types.php I added some code to the function Thomas pasted earlier to call for a product_type flypage:
Quote
   /**************************************************************************
   ** name: listrow_product_type_element()
   ** created by: Thomas Freeman by modifying list_product_type
   ** description: Returns html code for show parameters
   ** parameters: product_id
   ** returns:
   ***************************************************************************/
   function listrow_product_type_element($product_id) {
      global $VM_LANG, $mosConfig_live_site;

      if (!$this->product_in_product_type($product_id)) {
         return "";
         }

      $dbag = new ps_DB;
      $dba = new ps_DB;
      $dbp = new ps_DB;
      $html = "";

      $q  = "SELECT * FROM #__{vm}_product_product_type_xref ";
      $q .= "LEFT JOIN #__{vm}_product_type USING (product_type_id) ";
      $q .= "WHERE product_id='$product_id' AND product_type_publish='Y' ";
      $q .= "ORDER BY product_type_list_order";
      $dbag->query( $q );
      $q  = "SELECT * FROM #__{vm}_product_type_parameter ";
      $q .= "WHERE product_type_id=";
      while ($dbag->next_record()) { // Show all Product Type
         if ($dbag->f("product_type_flypage")) {
            $flypage_file = PAGEPATH."templates/".$dbag->f("product_type_flypage").".php";
            if (file_exists($flypage_file)) {
               $html .= include($flypage_file);
               continue;
            }
         }

         // SELECT parameter value of product
         $q2  = "SELECT * FROM #__{vm}_product_type_".$dbag->f("product_type_id");
         $q2 .= " WHERE product_id='$product_id'";
         $dbp->query($q2);
         
         // SELECT parameter of Product Type
         $dba->query($q.$dbag->f("product_type_id")." ORDER BY parameter_list_order");
         $i=0;
         while ($dba->next_record()) {
            $html .= "<td style=\"text-align:center\" id=\"Product_Type_Element\">";
            $html .= $dbp->f($dba->f("parameter_name"))." ".$dba->f("parameter_unit");
         }
      }
      return $html;
   }

This seems to work fine and I made a product_type flypage based on a post by macallf elsewhere in the forum:
Quote
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
*
* @package VirtueMart
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName( __FILE__ );

Global $perm;

//if(!$standard)
//    return "";

   
            $html1 = "\n<table id=\"product_type\" class=\"product_type\" width=\"100%\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\" >\n";
         // SELECT parameter value of product
         $q2  = "SELECT * FROM #__{vm}_product_type_".$dbag->f("product_type_id");
         $q2 .= " WHERE product_id='$product_id'";
         $dbp->query($q2);
         // SELECT parameter of Product Type
         $dba->query($q.$dbag->f("product_type_id")." ORDER BY parameter_list_order");
         $i=0;
         while ($dba->next_record()) {
                $label = $dba->f("parameter_label");
                //Check for store admin if not dont show these fields
                //if (!$perm->check("admin,storeadmin")) {
                //    if ($label == "Film No." || $label == "Frame No." || $label == "Full Image File Name" )
                //    continue;
                //}
                    if ($i++ % 2)
                    $bgcolor=SEARCH_COLOR_1;
                else
                    $bgcolor=SEARCH_COLOR_2;
                $html1 .= "<tr  bgcolor=\"$bgcolor\" height=\"18\">\n";
                $html1 .= "<td  width=\"50%\">&nbsp;".$label;
                $parameter_description = $dba->f("parameter_description");
                if (!empty($parameter_description)) {
                   $html1 .= "&nbsp;";
                   $html1 .= mm_ToolTip($parameter_description, $VM_LANG->_PHPSHOP_PRODUCT_TYPE_PARAMETER_FORM_DESCRIPTION);
                }
                $html1 .= "</td>\n<td  >&nbsp;";
                    $param_name = $dbp->f($dba->f("parameter_name"));
                $html1 .= $param_name." ".$dba->f("parameter_unit")."</td></tr>\n";
               
         }
         $html1 .= "</table>\n";
           
            return $html1;
           
?>

Having studied the above code (with my lack of PHP knowledge) I think I know how to place the $lable and $param_name variables in a table using $htmll. The problem is that I don't know hoe to call the product type attributes ($lable and $param_name) individually in order to place them in the tablecells where they belong. Í hope I am making sense at all as I am new to all of this...

Would someone be willing to help me out on this? I have added an image of what I would like to achieve...
Any help would greatly be appreciated!

Thanks in advance,

Jesse

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: dazzzl12 on October 31, 2006, 22:31:23 pm
Hi,

i`m a relative beginner with vm and read the whole thread about this nice modification.
but i cant understand all things you`ve written. my english is to poor for this
please can anyone make a post with a FINAL .zip???
best a .zip like this JPG: ex_album_display.jpg
thanks....

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on October 31, 2006, 22:40:41 pm
Hi,

i`m a relative beginner with vm and read the whole thread about this nice modification.
but i cant understand all things you`ve written. my english is to poor for this
please can anyone make a post with a FINAL .zip???
best a .zip like this JPG: ex_album_display.jpg


The latest full version is attached below.

This does not include the mod as in the image you state.

This is not a modification that I've made, so I have not tested it and cannot guarantee its functionality. There fore I cannot support it.

To Install unzip into your-site/administrator/components/com_virtuemart/  (Where your-site is the root of your joomla install)

It will overwrite several files SO BACKUP YOUR FILES FIRST

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kooolkat357 on November 07, 2006, 09:50:09 am
Hi!

After i installed your mod my layout get messed up. Before install the boxes were lined up vertically and now they are horisontally.

Can you please help with this problem?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 07, 2006, 14:29:03 pm
Which boxes?

A link to your site or a screenshot would help

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: kooolkat357 on November 07, 2006, 15:25:39 pm
Hi!

You can look at it here: http://www.mobileksperten.com/butikk/butikk/postal-unlock_10/sony_ericsson_unlock_18.html (http://www.mobileksperten.com/butikk/butikk/postal-unlock_10/sony_ericsson_unlock_18.html)

Sorry for not inserting it in the last post.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 07, 2006, 16:21:38 pm
Thats what I thought.

the reason for that is if you are listing several children with attributes the page soon fills up.

So I changed it so that the attributes are listed in a row.

If you edit ps_product_attribute.php and search for this code, which is in function list_advanced_attribute about line 687.

$html .= "<td align=\"right\" valign=\"middle\">";
$html .= "<label for=\"".$titlevar."_field\">$title</label>:";

and replace it with this code

$html .= "<div style=\"width:30%;float:left;text-align:right;margin:3px;\">";
$html .= "<label for=\"".$titlevar."_field\">$title</label>:</div>";
$html .= "<div style=\"width:60%;float:left;margin:3px;\">";

further down you'll find this code

$html.="</select></span></td>\n";

replace with this

$html.="</select></span></div>\n";

that will restore the original layout, but keep the child list.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: kooolkat357 on November 07, 2006, 17:20:38 pm
Greeeat, now it's like it should be....

Thx

Kooolkat357
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: mark R on November 10, 2006, 22:45:01 pm
Hi all,

Would it be possible to get the available QTY, to display in the child list??

thanks in advance

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: Johnny33 on November 11, 2006, 15:06:02 pm
Hi all,

Would it be possible to get the available QTY, to display in the child list??

thanks in advance

Mark

Is it also possible to get the "Usually ships within.." icon to be displayed?

Thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 11, 2006, 15:17:55 pm
Anythings possible.

Yes it can be done, but I'm not going too!

The code I have placed is for general use and contains the features most want or need.

If you wish to modify the code for your own use go ahead, it's what it is there for.

If you read through these posts you will see several pointers to where things need to be modified to do what you want.

I'm sorry if this sounds harsh, but I,m busy incorporating this into VM1.1, where it will be a standard feature.

Plus working on paid work!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 13, 2006, 10:55:44 am
Hi,

Thanks for this excellent mod. I have updated to VM 1.0.7 and applied your code to the site. It works fine. However all my children products have 2 prices next to the add to cart. It has it listed like it was on special with a strike through the price in red and then the current price, even though the specials box is not ticked on the parent or child product and the prices are the same. You can see what I mean here:
http://www.sissey.com.au/index.php?page=shop.product_details&flypage=shop.flypage&product_id=9&option=com_virtuemart&Itemid=33

Any ideas?
Thanks
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 13, 2006, 11:45:10 am
Hi,

sorry about that, I forgot to update to handle that!!

in ps_product_attributes.php

search for this code it appears twice in the file :

                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= "<span style=\"color:red;\">\n<strike>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
                    $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"]);
                    $html .= "</td>";
 
replace with this

$html .= "<td width=\"10%\"align='right'>";
                    if($price['product_price'] != $actual_price['product_price']) {
                        $html .= "<span style=\"color:red;\">\n<strike>";
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</span>&nbsp;";
                        $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"])."&nbsp;";
                    }
                    else {
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."&nbsp;";
                    }
                    $html .= "</td>";

This now checks to see if the discounted price = actual price if it does it displays only the price, if there is a discount it will display as you see it now

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 13, 2006, 12:12:07 pm
Hi Mark,
Thanks for the reply. Which one do I modify, the first or the second occurance?
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 13, 2006, 12:34:55 pm
Sorry, I should have said.

I'd do both - The first is for one add to cart button, the second is for the multiple add to cart buttons

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 13, 2006, 21:43:26 pm
Hi Mark,
No need to say sorry, really. This is an fantastic add on and I am glad to read that it will be built into VM 1.1
Your fixed worked like a charm.
Thanks again
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 14, 2006, 01:45:44 am
This is a fantastic mod - very clean. I wanted to show the discounted price in the table. How would I do this.Ideally I would like to show gross price, discount, net price for each product.
I have installed the mod to show strike out and net prices for products with child items, but this doesn't affect the price shown for products without child items.
I can set up each product with a child item and this then works, but it would be a lot of work and also difficult for shoppers who woule have more  mouse clicks to get to the cart



Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 14, 2006, 13:45:26 pm
thomas_freeman



1 problem though when i have a product WITHOUT any child products it still show the full price where the child products are displayed on the product details page . any ideas?

thank

Did you find an answer to this -  I also have products without children
John
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 14, 2006, 14:23:37 pm
The price display mod for child items is also in shop.product_details.php, this show products without children. Look for the addtocart routine in here and alter the price display the same way as in ps_product_attributes.php.

This will then give a unified look across the site.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 14, 2006, 14:40:02 pm
The price display mod for child items is also in shop.product_details.php, this show products without children. Look for the addtocart routine in here and alter the price display the same way as in ps_product_attributes.php.

This will then give a unified look across the site.

Mark
[/color]
I did this and it removed the pricing from the product list just above add to cart for products with no child items, which is fine. The add to cart button now sends me to the 'view all products page which is a bit confusing
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 14, 2006, 15:09:46 pm
Then something else must have been altered as well! The price has no affect on the add to cart.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: Amina on November 15, 2006, 00:30:19 am
Hi mark,

Glad to see you are still on the case.. ;)

Wondering if you could make a sticky to with the files you have modified.
They have got it over at open-sef for the virtuemart sef file and it looks
clean instead of looking all over the thread for the desired files. 

just list them and their functions and attach the sticky post.

thats all in one post.

love Amina
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 15, 2006, 00:58:31 am
VirtueMart 1.1 Specs for childlist

See the screen shot of the backend, and how it can look in the frontend.
Pic 1 Admin for product the second attribute width should be class suffix
Pic 2 child list with 1 add to cart button and include 2 extra product id's
Pic 3 childlist with an add to cart per product with 2 extra product id's
Pic 4 Single item with 2 extra product id's

As you can see its quite configurable and should hopefully cover all circumstances.
 
Remember this is not for the current release of vm and will not be updated to include these new functions.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: Amina on November 15, 2006, 01:00:47 am
Sorry I missed the post about the include in 1.0.1.  That is good enough for me.
Can i ask if you know about the affiliate solution for 1.0.1 ?  I means is it on the table.
When is the release date?

Thanks Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 15, 2006, 01:17:28 am
I don't know anything about the affiliate solution, sorry. Release date, again I can't give a date. Were still in the alpha stage.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 15, 2006, 12:01:38 pm
hi mark,

first of all: good job!

Now there's only one question left: how can i combine your this mod with my price breaks?
the list shows "0,00 €" always, but after I added the item to the cart it's calculated correctly.

Does anyone have a hint how / where to integrate {product_price} to the childlist?
Many thanks in advance!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 15, 2006, 12:08:19 pm
Have you set your first price range quantity to start from 0? e.g. 0 to 9 price 1, 10 - 19 price 2 etc

If you haven't this will show as 0.00 on the child page!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 15, 2006, 12:21:11 pm
Yes, i have, when I check the product details in the backend the price is also shown under "Item Information", but not listing up in the childlist :(
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 15, 2006, 12:29:50 pm
Well, I don't know what else to suggest. The only scenario when the price displays as 0 is when the first quantity range does not start at 0.

I have tested and this is how it works on my site. The price range quantity start is set to 1 and I get a 0 price, the quantity starts at 0 and the price is shown as it should.

I don't know what else to suggest. Have you a link to your site?

Maybe then I can work it out.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 15, 2006, 12:31:31 pm
oh you were right, ALL child items need to have a price that starts at 1, i skipped one because i was too lazy tochange them all XD

But still, I somehow need to show all prices per item (we have three each)

Many thanks for your help!!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 15, 2006, 12:37:51 pm
are all the child item prices the same?

If they are you can just set the prices in the parent and clear all the child prices. The price table will then show on the main page. If not you will have to re-write the pricing code for the children. Possibly using the same method on the browse page, which will show an info icon and when the mouse is hovered it displays the price table.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 15, 2006, 13:14:00 pm
Thanks Mark, yes, we have different prices per item.
My plan is to alter the price display of the parent item to show something like "starting from: xx,xx€", where xx:xx shows the lowest child-item price.
I will solve this by changing the language file and enter the lowest price manually to the parent item.

I'll try it with your suggestion to rewrite the pricing code for the children. It would be nice to get a hint about which files exactly have to be altered - I'm not a PHP professional, but I'm the master of S.C.P* ;)

*search - copy - paste
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: FDifferent on November 16, 2006, 03:24:55 am
I was wondering if drop down mode will work in old mambo phpshop 1.2 version? Thank you.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 16, 2006, 11:19:33 am
I was wondering if drop down mode will work in old mambo phpshop 1.2 version? Thank you.

This is designed for Virtuemart, it always has been and has been updated to reflect the changes in VM. I don't think it will work in phpshop, allthough the code to show the drop down quantity boxes could obviously be re-used.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 16, 2006, 12:14:40 pm
Hi,
I would like to know if it is possible to have the shop go to the checkout when the add to cart button is clicked. ATM it refreshes the page. Can this be done?
Thanks
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 16, 2006, 13:38:15 pm
If you are using the latest version of this mod then there is an option in the main vm configuration. Which asks if you stay on the product page or go to the checkout.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 16, 2006, 13:43:19 pm
I am using the latest version. Is it in Admin > Configuration and if so where as i cannot see it
Thanks
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 16, 2006, 13:56:22 pm
Yes it's in the main config, see screenshot

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
Post by: Andrew on November 16, 2006, 21:32:41 pm
Hi Mark,
Thanks for that. Interestingly enough it was already unticked, so I ticked it and saved the config and unticked it and saced again and that fixed it.
Andrew
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: yorjaus666 on November 17, 2006, 12:12:20 pm
This function seems to do the trick but maybe this is a stupid question but:
Where do I start whith this hack. Do I have to start from the beginning and work through everything or is there somewhere all is put together? Would be nice to get this function without going though 17 pages of replyes!

/Mr T
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
Post by: macallf on November 17, 2006, 12:46:00 pm
The latest full mod is here

Childlist 1.0.7 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg58961#msg58961)

There is also a link on the first page to it.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: MartijnBoeve on November 17, 2006, 15:10:46 pm
for a clothing store I'm looking for a way to set up different stock for different sizes, I think this is a good one, I downloaded the package, but my problem is that I already made changes to the different files, so I can't just overwrite the files...

Do you have a list or something of the pieces in the files you changed? If not, i'll figure it out, but if you do it would save me a lot of time ;)

gr. Martijn
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 17, 2006, 15:25:12 pm
There are so many alterations it would be impossible to list them all.

Either use something like winmerge or a program that can make diff files.

I use winmerge to compare updated files for VM and alter my mods with any new features/fixes etc.

Mark

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: yorjaus666 on November 17, 2006, 15:40:30 pm
Will it work with the latest release of Joomla 1.0.11 with VM 1.07 or dows it only work with the stand alone VM 1.07 release?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 17, 2006, 15:51:03 pm
The ecommerce release of VM is just joomla 1.0.11 with vm 1.0.7 preconfigured. The files are all still the same. It's just a convenient way of packaging them together. So in short 1.0.7 is the same as the ecommerce 1.0.7 edition.

So it will work.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: Scaramouche on November 19, 2006, 15:23:05 pm
Greetings, Mark. Prompt how to make, please, updating in a basket one button for all goods. I am sorry for my English.
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: strats on November 19, 2006, 21:58:52 pm
I have read all posts of this topic as I was interested on making a cd store that besides selling cds, they also sell mp3. Many thanks to Mark and all you guys for your contribution to this mod. It's highly appreciated.
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 20, 2006, 00:13:45 am
Is it possible to set the default for the standatd qty box to 1 instead of 0
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 20, 2006, 00:42:53 am
They are set to 1, except for the multi addtocart. i.e. one addtocart button for several products. Otherwise your customers would have to deselect the products that they do not want, instead of selecting the products that they want.

Or do you want to make it difficult for your customers?

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: John - Australia on November 20, 2006, 01:01:35 am
Hi
I use one add to cart for each product/child.
The feedback we are getting is that when a customer presses add to cart, nothing happens as they have not entered a qty when they expected to have ordered one.
I can work around this by using a drop down qty range
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 20, 2006, 01:52:23 am
which version are you using? 1.0.7 will automatically set the min qty to 1 for an addtocart for each child.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 20, 2006, 03:50:41 am
Version 1.0.5
Thanks

which version are you using? 1.0.7 will automatically set the min qty to 1 for an addtocart for each child.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 20, 2006, 12:57:30 pm
The Mod for V1.0.5 does not have the drop down quantity range!, My Mod for V1.0.6 was the first to have this!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: John - Australia on November 23, 2006, 03:40:19 am
I have upgraded to VM1.0.7 and installed the childlist mod 107-2. Everything seems to be fine now
One minor point
In Line 64 of the language file, there is a spelling error. It says upadte, instead of update.

Superb mod
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf on November 23, 2006, 11:52:33 am
I have upgraded to VM1.0.7 and installed the childlist mod 107-2. Everything seems to be fine now
One minor point
In Line 64 of the language file, there is a spelling error. It says upadte, instead of update.

Superb mod

If you knew How Late I work on this, I hope you'll forgive a small spelling mistake  :)

Glad it's working for you know

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: John - Australia on November 23, 2006, 12:14:40 pm
Hi
I felt so bad about pointing it out, I thought about it for 3 days - it seemed petty.
Thanks for all your help
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 24, 2006, 13:24:34 pm
Got Virtuemart up and running. but when I go into add a child product I get this  message.

Warning: Illegal offset type which is in com_virtuemart/classes/ps_product.php on line 1256 also on lines : 1281 1284

I am running 1.0.10 stable version of Joomla with 1.07 Virtuemart

any ideas?

Dave
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 24, 2006, 14:07:50 pm
VM 1.0.7 was brought out to coincide with Joomla 1.0.11.

I'd update joomla. This mod does not alter the ps_product.php file at these lines.

I'ts an incompatability issue with 1.0.7 and J! 1.0.10

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 24, 2006, 15:12:45 pm
Thanks for that Mark. Upgraded as suggested put still getting the same error. I will now look at Joomla forums to see if a solution is there.

Dave  ???
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Davec on November 26, 2006, 18:00:19 pm
Well I looked at the lines of code the product_id had the $ in front of it so it looked like the code below. I removed the $ and added ' at each end and the problem seems to have gone. I am no expert by any stretch and wondered if this had implications for the Virtuemart component!

if( empty( $_SESSION['product_sess'][$product_id]['flypage'] )) { WAS THIS now

if( empty( $_SESSION['product_sess']['product_id']['flypage'] )) {

Dave   :-\
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 26, 2006, 18:20:58 pm
No that's a session variable and that is fine, I'll double check my code, but I didn't think I did anything there.

So many modifications you sometimes get lost with all the code you change.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: nhcompi on November 26, 2006, 19:13:38 pm
Hi macallf!

Can I use this mod as a PC-Configurator? If yes, how?


Thanks!

Nico
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 26, 2006, 19:34:28 pm
Maybe!

how, I don't have the time at present to explain how it could be used.

It involves product_types and a lot of coding.

Not a quick question to answer and would probably start a whole new thread.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 26, 2006, 22:40:30 pm
Well finally getting there but now have the price displaying twice, once in black and once in red. I have not discounted the price as you will see from screen shot attachment. Also  need to get the child products to display small medium large etc which it isn't doing at the moment, any suggestions?

Dave  ???

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 26, 2006, 23:12:01 pm
This post explains how to change the striked out price, it checks if the prices are the same. If the're not it strikes out if they are it displays one.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg60183#msg60183 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg60183#msg60183)

The second, How are you specifying the size? The same as the colour?

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 27, 2006, 09:13:07 am
Thanks for that Mark. I have also gone about the second query a different way using attributes and it has solved the problem.

Dave  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 27, 2006, 12:00:37 pm
Hi, I need to bother you again Mark, I stil didn't manage to get more than one price shown in the childlist. This shouldn't be too difficult, but I just can't figure it out :(
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf on November 27, 2006, 12:37:19 pm
Hi, I need to bother you again Mark, I stil didn't manage to get more than one price shown in the childlist. This shouldn't be too difficult, but I just can't figure it out :(

In ps_product.php locate the function show_price, somewhere near the end of the function is the routine to show multiple prices.

You would have to use this in ps_product_attribute.php for the routines that I have created. list_attribute_list and list_attribute_list_multiple. In these routines the price routine is commented. You would have to add the correct code here to show the price breaks.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 27, 2006, 12:39:42 pm
Thanks a lot Mark, I'll try this!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: MartijnBoeve on November 27, 2006, 16:38:52 pm
Hi macallf,

I´ve been editing some loose pages to get the mod to work, i´ve been adding the code at the beginning of this thread, becouse I can´t just upload the files due to earlier edits to some of the files...

I do have the list instead of the dropdown and the standard add to cart disapears when it finds child items. My only problem now is that when I press the add to cart for a child product, it goes to the cart inmediately, but somewhere the childpage gets loaded becouse the childproduct gets displayed in the recently viewed products.

see http://www.southgate.nl/index.php?%20page=shop.product_details&flypage=shop.flypage&product_id=40&category_id=&manufacturer_id=&option=com_virtuemart&Itemid=26 (http://www.southgate.nl/index.php?%20page=shop.product_details&flypage=shop.flypage&product_id=40&category_id=&manufacturer_id=&option=com_virtuemart&Itemid=26) to see it work...

Do you know how to hack it so it displays the parent product instead of the child product in the recently viewed products?

gr. Martijn
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 27, 2006, 16:50:10 pm
The recently viewed products module is, if I'm not mistaken, not a standard vm module.

I would contact the author of that module, unless you are referring to a module by the wrong name.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on November 29, 2006, 14:25:03 pm
macallf,

I would really like to use Child List. So I donwloaded childList107-2.zip.  But I don't see any files that as new as this discussion.  Does this mean that I'll need to assemble all the extra code changes from this thread to get it working without issues rasied here, or am I misinterpreting? Should I wait until you've compiled the changes into another release?

BTW, thanks for your help in the other thread. You're a coding machine!

Justin
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on November 29, 2006, 14:39:56 pm
childlist 107-2 is the latest version and should run without any problems in VM 1.0.7.!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 29, 2006, 16:30:14 pm
Thought I had solved the following problem by using attributes and then selecting to display latest products for the sort order.

I am basically setting up, a site for clothing. So the size are S, M, L, XL, XXL with colour options. I added the the range in black but when I add White Small it is placed between the XL and XXL black (see screenshot). What I need of course is black with sizes ascending and then the same for white, blue, grey etc.

Is there solution for this?

Dave  ???

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 29, 2006, 16:41:36 pm
Will the SKU be in the correct order?

If it is change the queries in ps_product_attribute.php

From

$q = "SELECT product_id,product_name,product_parent_id,product_sku,product_in_stock FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'";
      
to

$q = "SELECT product_id,product_name,product_parent_id,product_sku,product_in_stock FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'
 ORDER BY product_sku";

There is also a similar query a few lines down, this needs to be altered the same way i.e. add the
 ORDER BY product_sku at the end.

This will sort the children by sku

Mark

      
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 29, 2006, 16:53:22 pm
My SKU's have been set the following way:

Black: D1 is the design, S is the size with BL representing black

D1SBL  = Design 1 Small Black

D1MBL = Design 1 Medium Black

and so on. The BL is then replaced with WH for white, GR for grey etc.

If you have a better suggestion for SKU's please let me know

Dave  :)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on November 29, 2006, 18:26:03 pm
My appologies for not seeing it yet

I installed the childList107-2.zip but I still get a add to cart button after each product
I am not using any childs as I lik to use one  add to cart . did  specify use checkbox with each product

Must be missing some other change /adjustment I need to do , so please any guidance possible to get the lightbulb  going

thanks

eens mijn frank valt lukt het well




Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 29, 2006, 18:43:49 pm
My appologies for not seeing it yet

I installed the childList107-2.zip but I still get a add to cart button after each product
I am not using any childs as I lik to use one  add to cart . did  specify use checkbox with each product

Must be missing some other change /adjustment I need to do , so please any guidance possible to get the lightbulb  going

thanks

eens mijn frank valt lukt het well


http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg37613#msg37613 (http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg37613#msg37613)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on November 29, 2006, 22:05:25 pm
thank you ,

"adding" a browse_x_footer is what I was missing
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 29, 2006, 22:55:15 pm
My plot seems to have thickened just a bit. I have now added 20 products and the only one which will not display S, M, L, XL, XXL in the correct order is Design 3. I have tried cloning different products and even added it from scratch but still no joy  ??? I have attached one screen shot for Design 3 and one for Design 20. Attributes are all the same the only difference being the actual design on the garment!

Any ideas, this is driving me mad  :-\

Dave

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on November 30, 2006, 00:17:16 am
 >:(

hmm, works...until one  lists all products or does a search , than it reverts to standard and cant get back to what it is set for
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on November 30, 2006, 01:31:10 am
It's was only designed to work on the individual categories page. I never done any testing with all products or search

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on November 30, 2006, 01:47:32 am
ok, thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on November 30, 2006, 03:23:37 am
Mark,
Sorry if this is obvious and I'm just not seeing it...

My understanding is that I should just unzip childList107-2.zip into <site>/components/com_virtuemart/ and then...
But I don't see anything new on Product Information tab. I also don't see the store product page attribute dropdown switch into a form for each variant.

Was the mod supposed to add classes, html, & languages folders to com_virtuemart directory?
Is there a howto somewhere?

Thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf on November 30, 2006, 08:21:24 am
Mark,
Sorry if this is obvious and I'm just not seeing it...

My understanding is that I should just unzip childList107-2.zip into <site>/components/com_virtuemart/ and then...
But I don't see anything new on Product Information tab. I also don't see the store product page attribute dropdown switch into a form for each variant.

Was the mod supposed to add classes, html, & languages folders to com_virtuemart directory?
Is there a howto somewhere?

Thanks

You were close

it's your-site/administrator/components/com_virtuemart/

You had missed out the administrator part. In doing so you have added all the files to where they will never be accessed.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on November 30, 2006, 09:34:35 am
Finally sorted it out. Involved changing the SKU to something else, then putting how I wanted it in the right order. I then cloned each size and changed colour and all seems to be working well. Still puzzled though as to why this happened on product 3 only...

Dave
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on November 30, 2006, 19:42:42 pm
Ah, thanks!
But I'm totally not getting this  ???
I added childList107-2.zip to the proper place, and now I see the Child options under the 'Display Options' tab. But selecting anything & everything makes no difference to item view in the store -- still has same drop-down box for varient (attribute) selection.
I also tried changing the SKU and adding Attribues via the Add Attribute form (which goes into the void  -- I can't find where the two new attributes I created went).
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Davec on December 01, 2006, 10:15:35 am
Have you created a New Item? This then becomes the child product. The settings in the attached image produced the look in the actual cart.

If you check the manual for Virtuemart it explains how to creat a new item.

Dave

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: pikibou on December 01, 2006, 13:31:39 pm
Hi!

First of all, Thank you very much for that solution!

I just have a little problem and hope you'll be abble to help me.

I have 709 product parents and they all have child products.

The hack works great if I edit the products One by One and choose "Use List box for child products".

But, is there a way to do that for all product at the same time?

Thanks,

Piki

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on December 01, 2006, 15:04:11 pm
one little problem still

I am getting a gray add to cart button in a list ( others are the graphical one)

G
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on December 01, 2006, 16:51:15 pm
In the example above you have a table of choices -- two columns: Color and Size. Looks great, but for the life of me I can't replicate that :(

Without the mod, the method of creating varients is using the Attributes form:

   Attrb1,var1a,var1b,...;Attrb2,var2a,var2b,...

As everyone here knows, this gives the product two pulls down forms. And that's all I'm able to get.

With the mod, do you still use the Attribute form to enter the variables?

** Edited for the sake of not leaving stale incorrect info in the forums **

When, with the mod, I create a new product catagory, product type, and product, and setup several attributes with a few varients each, and use the settings shown in the image above, I see the same pull downs as before.

Correction: I was not aware that the child products are created as separate products but ONLY UNDER the menu: Curret product -> Add Item or New item icon. They also have "attributes", but they are different from the attribute field used to create radio buttons or pull-downs for a parent item (3rd tab).

So either my mod isn't installed properly (or there's some other problem with the site), or I'm not creating/configuring the product as prescribed (I haven't seen a detailed guide for the mod -- is there one?). 

And it seems that the switch to enable/disable the mod is simply the "List: Use list box for child products" checkbox. Is that correct?

Thanks again for any clarifications.
-Justin

----
ps, can anyone tell me why my IP is shown, vs "logged"?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on December 04, 2006, 15:25:30 pm
This mod is not for changing how the attributes are displayed, it is for the child products only. Add an attribute to a product using the top left menue, then select "Add item" (or similar) from the same menue. This item becomes the child items, you can enter a value for the previously added attribute on the third tab (product status or something like that).
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on December 04, 2006, 20:44:13 pm
Quote from: mog
This mod is not for changing how the attributes are displayed, it is for the child products only. Add an attribute to a product using the top left menue, then select "Add item" (or similar) from the same menue. This item becomes the child items, you can enter a value for the previously added attribute on the third tab (product status or something like that).

Ah-ha! So I've been creating the Child items incorrectly. I see where this is going.

Ok, if I open a product, then on main Virtumart menu, I see: Product | Current Product | Add Item (note that this menu link is not available as an icon at the top Virtumart's Product view).  However this takes me to a New Item form, not Child.

Mog, can you please explain "top left menue" -- where are you creating Child product items?

Thanks
-Jaz

 
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 05, 2006, 11:12:35 am
Once your parent product has been created, edit that product and select add attribute from the icons at the top. This attribute is the reference for the child product such as color, size or whatever you want. Once this has been created you can then select add item. This will add the child product.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on December 05, 2006, 11:32:02 am
Yeah that is right, I keep mixing up left an right XD the buttons mentioned come together with the save/apply/cancel... buttons.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on December 05, 2006, 14:40:12 pm
Thanks guys. But it just ain't happening for me.
This is so frustrating -- I feel like I seem like an idiot on this board, but I'm not an idiot, I swear!  I've been doing web/sql stuff for 8 years, and working with Mambo/Joomla for 5  :-\

From what read and been told:

0. Backup files
1. Unpack childList107-2.zip into <site>/administrator/components/com_virtuemart/
2. Creat a new product, checking boxes and radio button as in above post by Davec, Save
** Edited for the sake of not leaving stale incorrect info in the forums **
3. Edit product, and choose new attribute from top, right icon. This creates a child product.
** Should have been:
3. Edit parent product, then pick New Item icon (from top right icon group) or choose VM menu Products | Current product | Add Item -- this creates a CHILD item! **

I did this, adding five child items, and I still see only a normal format when I view the product.

(sigh).

If I have the parent product open, and browse the menu to: Product | Current product | List Attributes, then I see the 5 children.

Are the above steps incomplete?

-Jaz

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mog on December 05, 2006, 15:36:51 pm
Ah ok i got the mistake.

These are not the children, but just the attributes.

Delete these attributes and create 1 new one. In your case a mathcing name would be "size".
Now go back to the parent item and select "add item". You will see a page with blank fields, same like setting up a whole new product. you can add your own sku, price or whatever. everything that is empty will take the data from the parent product.

On the third tab (product status or something like that) you will now see a field labelled "size", this is the attribute that you definied earlier. You can now enter "8 inch". save this item and go back to the frontend.
if you check your product now you should see the item - parent product with 8 inch- at the bottom of the page.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on December 05, 2006, 17:50:42 pm
This brings up an issue that I also had with Attributes when I first attempted to set up child items.

We use the term Attribute for two very different purposes.  I don't know the history on this but I'm guessing that someone created the child concept from an existing attribute system and never separated the procedures to work with them.

This makes it complicated, not only for us to learn and work with but also for my clients.  I have used different names for it in training so that they see a difference.

Just a quick note while thinking about it.
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on December 05, 2006, 18:03:11 pm
Thank you!

I'm now able to use child products!! Yea!!

So, after trying a few things, here are some nit picky observations:

1. Once the parent item is created and the attribute set, There are two ways to add the child:
  a) from the New Item icon in the upper left,
  b) from the horizontal VM menu: Product | Current product | Add Item.

Since one says New and the other Add, it's a bit confusing.

2. Once the "New Item" is saved, the next page says "Item Add Results: <child name>". At this point, I can
  a) goto horizontal VM menu: Products | Current product | Add another item -- in which case it takes me to a new-new item, not a child creation of current item. Since this is different from 1.b (above), this is quite confusing.
  b) click on <child name>, which takes me to the child, not the parent. -- so to add another child I have to navigate the to full product list and select the parent product.

Now that i have the hang of it it's cake, but these concepts were a bit much to guess since I just started using VM a few days ago.

Also, I see that the child products are sorted by name not order of creation, nor do I see the typical form to set the display order.

last, I would like to have a table of sizes, but a pulldown for colors. I tried adding Attributes to both the regular and custom fields, but I don't see any dropdowns.

**Can I not combine the use of child products and attribute dropdowns?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on December 05, 2006, 18:06:31 pm
This brings up an issue that I also had with Attributes when I first attempted to set up child items.

We use the term Attribute for two very different purposes.  I don't know the history on this but I'm guessing that someone created the child concept from an existing attribute system and never separated the procedures to work with them.

This makes it complicated, not only for us to learn and work with but also for my clients.  I have used different names for it in training so that they see a difference.

Just a quick note while thinking about it.

Yes, I think the term "Attribute" as related to child products should be renamed to Child, or Product Varient, etc. Certainly, if a menu pick or icon exists for the sole purpose of creating child item (if not reusing a menu pick) then it should be labled "Add Child Item" or such. Likewise, if a parent item has children, then it would be helpful if it showed up somewhere on the product edit page.

It's a very nice mod for displaying a table product options. Thanks!!

-Justin
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: dec on December 05, 2006, 20:47:36 pm
Is it possible to use Childlist modification and CSV Improved together?

Thanks!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: doggy4s on December 06, 2006, 04:00:27 am
is there a bug ??

scenario: no flypage specified in admin site configuration
flypage_x specified in category settings
there are 2 flypages available : flypage_new and flypage_x

from browse page to flypage flypage_x is used correctly

when going to flypage from link in cart to product flypage_new is displayed



also still only get a grey standard add to cart button when  using list / on add to cart button  in browsepage

thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 06, 2006, 12:31:17 pm
The addtocart button uses the standard vm style, I have double checked the files and this is sepecified the same as the browse page and product details page. (This is in the mod 1.0.7-2).

The flypage will use the correct the flypage that is specified. I suggest you check the url to see which flypage is being specified.

Perhaps you changed flypages and haven't cleared your browsers cache.

I have tested and there is no problem. NOT A BUG

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: VMuser on December 06, 2006, 19:39:31 pm
Does any one know how to hide or disguise the parentheses and equal, plus, or minus signs by some means or using css?

I have a customer that only wants to see the price and not the code. I thought about breaking apart the string and setting a class to hide them. Has anyone got a better idea?

Thanks,
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 06, 2006, 19:45:41 pm
Does any one know how to hide or disguise the parentheses and equal, plus, or minus signs by some means or using css?

I have a customer that only wants to see the price and not the code. I thought about breaking apart the string and setting a class to hide them. Has anyone got a better idea?

Thanks,

Within this mod? As far as I am aware it does not show +,-,() or []. I think you are referring to attributes.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: mknz on December 06, 2006, 19:48:42 pm
THANK YOU MARK!!!
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: fidel on December 06, 2006, 20:16:25 pm
Is it possible to use Childlist modification and CSV Improved together?
Good question. I was wondering the very same thing. Has anyone tried this with improved CSV?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: dec on December 06, 2006, 22:08:16 pm
I have try it but same files share code so I think the only solution is to install one of them and after compare the files with the new to insert manually the code...

I think it can be a super cool upgrade to have the CSV Improved ChildList Mod ready to install. ;)

Thanks!
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: RolandD on December 06, 2006, 23:11:56 pm
I have the childList107-2.zip file and I checked that against the CSV Improved but the only problem area I saw was the English language file. Am I missing something here?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 07, 2006, 18:31:02 pm
Firstly, great mod, really great support... well done!!!

I am a little confused though.  I have spent all day reading the threads for this mod and seem to have gone backwards from what i was trying to achive.

I have installed the mod [version childList107-2] on a fresh copy of Joomla 1.0.11 and VM 1.0.7, the install went well...ish

When i look at the products with children they display like this:
(http://www.2percentinspiration.com/mod.jpg)

Is that right? At the start of this mod thread it was displaying the children as a list getting rid of the drop down?

I have tried using the code from the first page of this thread and that made my products display how i wanted them... kind of.  I was now getting an issue with an extra add to cart button being displayed, which was fixed later on in the discussion but removed the other add to basket issues (which i want to keep).  With this version i also wanted to eliminate the problem where when you select a child it changes the details to that specific child and i want it to go to checkout when the user has selected their item.

can anyone advise what i need to do? should i install the latest version or start from the beginning?

im sure that my issues are down to me, but im lost now and seem to be going nowhere.  This looks a fantastic mod and contains pretty much everythning i want but in different versions.

please help
John
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 07, 2006, 18:53:34 pm
There has been so many posts in this thread that it is hard to keep track of!

But this post http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg52992#msg52992 (http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg52992#msg52992)

Should help. It shows the screen shot of the product entry screen in the vm backend and the new tab for display options. To use as a list You have to specify for each product that you wish to use it as a list and the style you require. The info in this screen refers to all childlist mods since version 1.0.6

This should help

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 07, 2006, 19:01:55 pm
Thought it would be something simple!! Guess i must have skimmed over that page!!!

Just had a quick look now and think that is what i want. I got it displaying as a list anyway!!! I will look more in a little while.

Thanks Mark, your work here is fantastic and greatly appreciated. Excellent Mod

John
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 07, 2006, 19:59:58 pm
Hi Mark,

Just been looking at what you said... its working pretty much how i want it now, just a couple of questions. 

The price is showing with a price and a price in red crossed out is is possible to prevent this and simply show the current price?

Is it possible to add the stock code into the list?

You discussed on page 3 of this thread about sending the user to the shopping basket once they have selected a item (as apposed to the method now where it simply adds to the basket) - will this work with version 1.0.7?

Can i change it so that instead of the list containing the description it shows an attribute "size" - for example my shop will be selling life jackets amongst other things which will have small, medium, large sizes.  At the moment i am using the description field to add S, M, L but when you view the basket that is what shows up.

I realise you are busy but if you could point me in the right direction again it will be greatly appreciated. 

thanks for your help so far Mark

John
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: teemu_m on December 07, 2006, 21:25:55 pm
The price is showing with a price and a price in red crossed out is is possible to prevent this and simply show the current price?

File .../com_virtuemart/classes/ps_product_attribute.php
Remove or comment away these two lines:
    // $html .= "<span style=\"color:red;\">\n<strike>";
    // $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";

Edit: BTW, this mod seems to work great. I really hope it or something similar will be included to core VM. Thank you very much!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 07, 2006, 21:34:58 pm
excellent thanks teemu_m

John
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on December 11, 2006, 18:59:23 pm
I just noticed that the attribute fields in the backend require escape characters.  What is the best way to change this to accept normal text?  I'm not looking forward to asking my clients to use &quot; for quotes.  Is there an easy way or a good reason not to change this?  Thanks!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 12, 2006, 16:52:50 pm
I just noticed that the attribute fields in the backend require escape characters.  What is the best way to change this to accept normal text?  I'm not looking forward to asking my clients to use &quot; for quotes.  Is there an easy way or a good reason not to change this?  Thanks!

Which attributes are you referring too? As far as I am aware I have not touched that part of VM, if you could elaborate then maybe I can help.

The price is showing with a price and a price in red crossed out is is possible to prevent this and simply show the current price?

This post explains how to change the code so that if there is a discount it is displayed with the actual price crossed out. If there is no discount it just displays the current price.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg60183#msg60183 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg60183#msg60183)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on December 12, 2006, 17:53:49 pm
Quote
Which attributes are you referring too?

On the backend, in the Item Status tab.  At the bottom of the page it shows the attributes that you are using for the child items.  These attributes are used in the display of children items.  However, if you modify them using quote marks it loses everything in the field from the quote to the end unless you use escape codes (&quot; etc.)

I've attached an image.

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: VMuser on December 12, 2006, 18:32:10 pm
Thomas, I've noticed this as well. As a work around, I use 36-in, 4-in, etc...

If you look around the internet, it is pretty common to use something similar to 36-in, 36-inches, 36 inches, etc... in place of the " as it causes issues, though a nuisance...

As a suggestion, you could also do a string replace in the code to search through ps_product_attribute.php and convert the characters from -in to ". I had to do this to replace the parentheses and numeric indicator from a price like (=$111.50), so that only the price would display like $111.50 for a picky client.

Hope this helps,
Dan
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 12, 2006, 18:52:10 pm
Thomas,

I haven't changed anything in that area of the product. The same thing would happen with the unmodified version of VM!

Having checked the DB table and the frontend output, it is displayed and stored correctly. It is only incorrect when editing a created product. I assume this is because the escaped format of the string is not working with the form.

I have tested this and altered product.product_form and changed line 703 from

Code: [Select]
<text class="inputbox"  name="<?php echo $field_name?>" size="32" maxlength="255" value="<?php $db_attribute->sp("attribute_value"); ?>" />

to this

Code: [Select]
<textarea  class="inputbox"  name="<?php echo $field_name?>" rows="1" cols="32" maxlength="255" ><?php $db_attribute->sp("attribute_value"); ?></textarea >

Changing this to a text area seems to have done the trick. It will now display exactly as it should when editing the record.

Hope this helps

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on December 12, 2006, 20:32:41 pm
Thanks for your help!  I didn't mean to imply that it was the mod that was causing it, I just thought this might be the best place to get an answer to a problem that might effect others who are using the mod. :)

Thanks again for all your help!
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: punz on December 13, 2006, 15:04:40 pm
Hi macallf,

You are the man!!! I don't usually post or ask questions because I usually find what I'm looking for by going through just about every post. I don't like to bother peps with the same question and a bit of research never hurt. Anyways this is exactly what I was looking for. After going around and around and it finally clicked that this was what I was looking for. Awesome work!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on December 14, 2006, 00:15:17 am
First off, thanks Macallf for fixing the problem displaying the quotes! That was bugging me too!

I'm having a problem with the way IE renders the child products w/ css.  The table is clunky because the headings are right justified (instead of left) and a bit large, and both the attribute AND custom-attribute areas want to be in a cell that won't column span, as it should (or does in FF and Opera, anyway.)  Please see images -- the first one shows the formatting problem.

Might it be VM or one of the ChildList files? I don't think it's bad CSS in my template (anyone?)

One aspect that improves the display a bit is to shorten the custom attribute form length from 30 to 20, but the colspan and justify problems are the kicker.

-Jaz

Edit:  I tried fixing this with colspan, but it turns out that IE doesn't support colspan=0. Funny, IE won't recognize colspan=<anything> in this code! Hmmm (???)

This is in ps_product_attribute.php, but I can't find where this class style is defined -- anyone?
$html .= "<table class=\"child_list\" width=100% align=\"left\">";

I changed colspan=\"0\" to colspan=\"2\" -- I just needed to get this fixed asap :)
Code: [Select]
                if (USE_AS_CATALOGUE != '1') {
                    $columns--;
                    $check_advanced = $this->list_advanced_attribute($product_id, $db->f("product_id"));
                    $check_custom = $this->list_custom_attribute($product_id, $db->f("product_id"));
                    if($check_advanced != "" || $check_custom != "")
                        $html .= "</tr><tr><td colspan=\"2\"><table width=\"100%\"><tr  bgcolor=\"$bgcolor\">";

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 14, 2006, 12:41:33 pm
Quote
This is in ps_product_attribute.php, but I can't find where this class style is defined -- anyone?
$html .= "<table class=\"child_list\" width=100% align=\"left\">";

Thats where it is defined in the code, if you wish to do any styling using css you do that yourself! I have just supplied the child list with its own class name.

You define the css yourself in your templates css file!

For the lining up of the attributes look in ps_product_attributes and the functions list_adavanced_attribute and list_custom_attributes.(Don't you just love IE6!)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on December 14, 2006, 17:23:16 pm
Quote
(Don't you just love IE6!)

LOL! Yeah, I'm reliving the horror of authoring this companies first website some 5 years ago -- it was even worse then cuz I didn't know css!

Hey, I have another question for you (sorry, I know I've been bombarding you with questions), but this seems to be a small issue with the display just after an item is added to the cart -- see in below image, the attribute is displayed as:
   <attribute name>:<default value><attribute name>:<selected value>
Notice that the vauses are proper in the session cookie -- it's just the display after the cart is updated. I just noticed this as I'm working on a mod to use radio buttons, so I checked and it seems to be in VM's cart or yous -- any idea which file spits out that block? (just point me to it and I'll futz with it). Thanks!

PS, I'm having trouble with the Info warning poping up when it shouldn't. It's class="shop_tip" -- do you know where that check is?

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 14, 2006, 17:42:34 pm
The attributes in the cart are displayed by basket.php in /html

look for the lines starting with

// Display attribute values if this an item

That's where the formatting is done.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on December 14, 2006, 19:03:18 pm
Quote
The attributes in the cart are displayed by basket.php in /html

I think that file works fine -- it's just after the cart is updated, a very brief mention of the item is listed just below the Cart link.

I updated the photo in my above post -- I circled what looks like some code stuck in during testing, which never got removed.

PS, I'm having trouble with the Info warning poping up when it shouldn't. It's class="shop_tip" -- does anyone know where that check is performed? (Once I've got the radio buttons working properly, I hope to make a checkbox in the product definition to toggle drop-down vs radio buttons.)

Justin
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 14, 2006, 19:25:50 pm
Quote
The attributes in the cart are displayed by basket.php in /html

I think that file works fine -- it's just after the cart is updated, a very brief mention of the item is listed just below the Cart link.

I updated the photo in my above post -- I circled what looks like some code stuck in during testing, which never got removed.

PS, I'm having trouble with the Info warning poping up when it shouldn't. It's class="shop_tip" -- does anyone know where that check is performed? (Once I've got the radio buttons working properly, I hope to make a checkbox in the product definition to toggle drop-down vs radio buttons.)

Justin

My mistake, I seem to have left a diagnostic check in ps_product_attribute.php @line 856 you will find

print $description;

delete that line. probably hasn't been noticed before, but as you are using attributes as well as the list mod it is being displayed.

Many apologies

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: Justin Z on December 14, 2006, 22:36:50 pm

That was it, thanks Mark!
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Justin Z on December 15, 2006, 18:30:24 pm

Having checked the DB table and the frontend output, it is displayed and stored correctly. It is only incorrect when editing a created product. I assume this is because the escaped format of the string is not working with the form.

I have tested this and altered product.product_form and changed line 703 from

Code: [Select]
<text class="inputbox"  name="<?php echo $field_name?>" size="32" maxlength="255" value="<?php $db_attribute->sp("attribute_value"); ?>" />

to this

Code: [Select]
<textarea  class="inputbox"  name="<?php echo $field_name?>" rows="1" cols="32" maxlength="255" ><?php $db_attribute->sp("attribute_value"); ?></textarea >

Changing this to a text area seems to have done the trick. It will now display exactly as it should when editing the record.

Hope this helps

Mark



I'd like to make this change too, but I'm a bit confused... (no surprise there!)

I assume you mean com_virtuemart/html/product.product_form.php (?).  My line 703 reads:

Code: [Select]
<input type="text" class="inputbox"  name="<?php echo $field_name?>" size="32" maxlength="255" value="<?php $db_attribute->sp("attribute_value"); ?>" />
I'm not sure how to form the beginning of the line. What am I missing?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: excogitation on December 15, 2006, 18:49:21 pm
Since you're all using this mod, can one please confirm what I'm experiencing here:

parent item has availability 0, but there are still child items for sale, but they don't show because
of parent availability 0.

Another thing, if you have check stock quantity set and don't display 0 items, this
mod does still show those 0 items.

Thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: thomas_freeman on December 15, 2006, 18:58:26 pm
I'd like to make this change too, but I'm a bit confused... (no surprise there!)

I assume you mean com_virtuemart/html/product.product_form.php (?).  My line 703 reads:

Code: [Select]
<input type="text" class="inputbox"  name="<?php echo $field_name?>" size="32" maxlength="255" value="<?php $db_attribute->sp("attribute_value"); ?>" />
I'm not sure how to form the beginning of the line. What am I missing?


I actually replaced the whole line like you have it, JustinZ, with the new code that Mark had.  I believe his first line may be from VM1.0.8 or another modification he had in the file.  It didn't match mine either, but the change worked.  Make sure you change the existing </input> to </textarea>
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on December 15, 2006, 19:03:59 pm
Justin_z

that is the correct line, I just didn't type in the correct begining of the line!

replace the whole line with the line that I specified i.e. the second line of code. That'll put in a text area for the output in the backend and display correctly.

excogitation

unfortunately thats the way vm works, if check stock levels is turned on and a product parent has a level of 0 the children won't be displayed. Set your parent product with a high stock level, this will ensure it is displayed.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: excogitation on December 15, 2006, 19:24:18 pm
@mccalff: what about the child products being 0? Should they also be displayed?

can you hint me towards the file that generates the child products (shouldn't be to hard
adding some function checking availability)
do you think it's hard to extend the availabilitycheck to also check for child products?

Thanks.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: excogitation on December 16, 2006, 10:48:55 am
So if you use check in stock and Override Child products Display Values and use parents and
Use List box for child products and Add to Cart Button for each Child

and don't want your not available childs NOT TO BE SHOWN ;)
ps_product_attribute.php add  AND product_in_stock>0 to your sql statement in line 430.

 ;)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 19, 2006, 21:12:59 pm
I read this thread a week or so ago and cant remember seeing the answer, so please forgive me for not reading it all again if the question is already answered!!

I have installed the mod and working great for items with children, but if i dont add children in, the product displays like this:


(http://www.siteground141.com/~jetcraft/Untitled-1.gif)

Is it possible to fix this? if so where?

Also, one other question, is how are the child products ordered? I have added in a load of sizes for one product (S, M, L, XL, XXL, XXXL) and on one product the order is right but on the other the XXXL comes before the XXL????

thanks again for a great mod!!

John
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 19, 2006, 21:43:23 pm
oh also, i forgot.... what is the piece bit???
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity mod
Post by: johnnybravo on December 21, 2006, 23:12:44 pm
can anyone help me on this?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: adel on December 22, 2006, 18:59:20 pm
hey ,

i ve installed the child mod 1.0.7 , i ve try to read the 23 pages , but i dont find what i want to do exactly. i just want to know how is possible to create a parents product and the child, like for example a tee shirt, and in child  the tee shirt size . thanks alot


Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on December 22, 2006, 21:46:36 pm
Adel,
Check the following post out:

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=22241.msg59994#msg59994 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=22241.msg59994#msg59994)

Hopefully that will help.
Title: Re: MOD: Child list - strike through
Post by: Lily on December 25, 2006, 12:38:27 pm
Hi Mark,
I join every user of your mod and express my gratitude for the nice feature and work!

I want to point out a typo when eliminating the strike through the original price. There is a </strike> missing at the end of                       
 $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</span>&nbsp;";

It should read
 $html .= CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";

Merry Christmas.

Hi,

sorry about that, I forgot to update to handle that!!

in ps_product_attributes.php

search for this code it appears twice in the file :

                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= "<span style=\"color:red;\">\n<strike>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
                    $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"]);
                    $html .= "</td>";
 
replace with this

$html .= "<td width=\"10%\"align='right'>";
                    if($price['product_price'] != $actual_price['product_price']) {
                        $html .= "<span style=\"color:red;\">\n<strike>";
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</span>&nbsp;";
                        $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"])."&nbsp;";
                    }
                    else {
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."&nbsp;";
                    }
                    $html .= "</td>";

This now checks to see if the discounted price = actual price if it does it displays only the price, if there is a discount it will display as you see it now

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: MyMusicVid on January 03, 2007, 15:52:42 pm
Hi

I have a problem using this with VM 1.0.8, i think the way the referring page is captured and used is different in 1.0.8, so after updating the shopping cart, i'm being referred to www.mysite.com/index.php and the default shop.flypage. Also, the Continue Shopping button is missing from the cart page, again i think it is to do with the referrer code. Otherwise, it seems to work as well as in 1.0.7.

One other thing I have noticed, is that the quantity boxes on the product details page show the number of products already added to the shopping cart, but if you increase that number and update the cart, you get the initial number already in the cart added to the number you entered into the quantity box - it adds, rather than updates.

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on January 07, 2007, 00:29:03 am
Hi Mark,

I just downloaded and installed 1.0.8.  I thought I remembered you saying that you were working on getting this mod into 1.0.8.  I didn't see it when I went to a parent product.  Did it not make it in?

Thanks for your help!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on January 08, 2007, 01:00:47 am
Thomas,

this mod will be integral to VM 1.1 not the 1.0.x branch.

Ensonix,

I will be updating the mod but when 1.0.9 comes out. 1.0.8 has a few bugs and a new version is due for release on Monday 8th Januray

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: thomas_freeman on January 08, 2007, 03:57:00 am
Thanks Mark! 

I'm kind of in a hard place.  My client needs to use paypal, so I've been working to upgrade them to 1.0.8 (I understand the PayPal is corrected in it).  I've become very intimate with Winmerge as I have been moving your mod up to 1.0.8.  I have it working right now at the minute, but I'm always afraid I might have missed something. :)

Can I make a recommendation.  As you incorporate it into 1.0.9 could you add some comments to show exactly where your mod begins and ends?  This would make it easier if there are any more intermediary versions to 1.1

I will keep watch out for when you have it updated for 1.0.9 and I'll try to hold my clients off until then.

Thanks again for all your work.  You do a great job.

Thomas
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: hobartimus on January 16, 2007, 03:14:24 am
I've used this mod on a couple of sites and it is working great. However, I have a new site that needs a slightly different function. I need for the parent product to have a price and the child prices to be added to the parent price. Is this possible or is my only choice to use a normal product attribute list? The reason I would like to do it with childs is so that I can have a base price and then a list so the customer can simply check the items to add.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: macallf on January 16, 2007, 13:26:58 pm
I've used this mod on a couple of sites and it is working great. However, I have a new site that needs a slightly different function. I need for the parent product to have a price and the child prices to be added to the parent price. Is this possible or is my only choice to use a normal product attribute list? The reason I would like to do it with childs is so that I can have a base price and then a list so the customer can simply check the items to add.

That would be a major change. But it can be done with the child mod as it is at the moment.

Set the base product without a quantity box, the following children to be set with a check box. That way the first child would always be selected and the purchaser would then check the extra items to add.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
Post by: hobartimus on January 16, 2007, 15:41:14 pm
So, the parent product is actually the first item in the child list? I suppose that would work. I'll give it a try. Thanks.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on January 21, 2007, 13:05:25 pm
Hi All

included is the update to use with VM 1.0.9. As usual just extract the files and copy the directories to your-site/administrator/components/com_virtuemart

Any problems please post.

I have tested this with VM 1.0.9 and Joomla 1.0.12

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: dustundag on January 22, 2007, 04:11:00 am
Mark,
Is it possible that a new parent can be build based on the already existing childs with  part numbers (link) similar to assembly? 
Thanks
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: strats on January 22, 2007, 10:30:41 am
To get rid of the red prices just comment the following lines at your administrator/components/com_virtuemart/classes/ps_product_attribute.php

// $html .= "<span style=\"color:red;\">\n<strike>";
// $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf on January 22, 2007, 12:34:26 pm
To get rid of the red prices just comment the following lines at your administrator/components/com_virtuemart/classes/ps_product_attribute.php

// $html .= "<span style=\"color:red;\">\n<strike>";
// $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";

Forgot about that

For a more elegant solution

n ps_product_attributes.php

search for this code, it appears twice in the file :

                    $html .= "<td width=\"10%\"align='right'>";
                    $html .= "<span style=\"color:red;\">\n<strike>";
                    $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</strike></span>&nbsp;";
                    $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"]);
                    $html .= "</td>";
 
replace with this

$html .= "<td width=\"10%\"align='right'>";
                    if($price['product_price'] != $actual_price['product_price']) {
                        $html .= "<span style=\"color:red;\">\n<strike>";
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</span></strike>&nbsp;";
                        $html .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"])."&nbsp;";
                    }
                    else {
                        $html .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."&nbsp;";
                    }

It checks for a discounted price, if there isn't any it just displays the price.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: hobartimus on January 22, 2007, 21:58:27 pm
I've used this mod on a couple of sites and it is working great. However, I have a new site that needs a slightly different function. I need for the parent product to have a price and the child prices to be added to the parent price. Is this possible or is my only choice to use a normal product attribute list? The reason I would like to do it with childs is so that I can have a base price and then a list so the customer can simply check the items to add.

That would be a major change. But it can be done with the child mod as it is at the moment.

Set the base product without a quantity box, the following children to be set with a check box. That way the first child would always be selected and the purchaser would then check the extra items to add.

Mark

This doesn't seem to be working. Items I set to "Hide Quantity Box" show a reglular quantity box on the the frontend.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: hobartimus on January 24, 2007, 03:44:06 am
How would I go about controlling the sort order of the child list? Is it possible?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Plavanie.com on January 28, 2007, 08:24:49 am
I get

Fatal error: Call to undefined function: get_product_attribute() in /administrator/components/com_virtuemart/html/shop.product_details.php on line 349

after extracting the file for VM 1.0.9....

Do I need to make any changes manually after extracting the file or just extracting should be enough?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: maddunr on February 05, 2007, 23:39:40 pm
Quick question..

Is there any documentation on adding columns to the child item list? For example, I would like to show the short description of the item (whenever it is there) along with the item name and attribute value.

Thanks in advance,
-V
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Esther Oriol on February 09, 2007, 20:52:34 pm
Hi all!

first post here. I've installed this hack and I have to say it's just the modification I needed for finishing my on line shop.

Nevertheless, I've found a a small bug... OK, it's not a bug... I'm going to explain my self....

When editing the options of the product at the "Display Options Label", at Drop Down Box Values section, I set the step value at 0... yes, I now, it seems impossible, but I'm not English native speaker and this things happen...

So, this caused a infinite curl that led my web server to a total hang.. May be a solution could be set this section as a dropdown box with a preset values, don't now!...
I've found what was the problem a day after causing it, and thought was interesting share with you...

Cheers!

esther (from Barcelona)
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: JJRO on February 11, 2007, 00:00:54 am
This mod is all buggered up.

1. Always adds (1) of everything on the page to the cart
2. Always overwrites anything already in the cart
3. Error when trying to link from the cart content to the product page

Is there another release of this? Or another way to do it?

TIA
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 11, 2007, 01:05:32 am
This mod is all buggered up.

1. Always adds (1) of everything on the page to the cart
2. Always overwrites anything already in the cart
3. Error when trying to link from the cart content to the product page

Is there another release of this? Or another way to do it?

TIA

1. If you have one add to cart button per page, the default quantity for each item is zero. Every item above 0 is added to the cart. The product page reflects the number of items already in the cart. Reason: if the default was one, for each time the addtocart button is pressed every item would be added to the cart once, forcing the user to set the items not required to 0.
2. As the product page reflects the number of items already in the cart any change to the quantity will overwrite, rather than adding.(The cart button is actually called update cart rather than add to cart!).
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.
3. I have tested this thouroughly with VM 1.0.9 and Jommal 1.0.12 and have no problems linking from the cart to the product pages.

So this mod is not all buggered up it's just your insight into how you want it to work that isn't satisfied. As for another way to do it, I'm the only one who as ever released a mod such as this and have updated and supported it since it's first incarnation to with with VM 1.0.5. Perhaps if you asked why it works the way it does rather than assume it's buggered up you may have got a nicer reply.

I'm sure the 277 people who downloaded the version for 1.0.7 and the 89 who have downloaded the latest version for 1.0.9 would have posted if it wasn't working correctly.

Mark

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: JJRO on February 11, 2007, 20:49:59 pm
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.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: thomas_freeman 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]
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf 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
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: thomas_freeman 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'
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: silexian 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
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: silexian 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 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=18330.0)

Thank you,
Silexian
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf 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
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: silexian 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
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: JJRO on February 13, 2007, 21:53:25 pm
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.
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: mike420 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?
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf 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 (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
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: mike420 on February 14, 2007, 14:59:52 pm
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.
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Andy 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

Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf 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
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Andy 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!
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: JJRO on February 15, 2007, 20:47:47 pm
Did that fix your problem, Andy?
I'm still having it jump to the cart...
The only other mod I did to the shop.browse.php was to have the category name replace the "BROWSE" text.
As per http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15682.0 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15682.0)
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: macallf on February 16, 2007, 01:04:17 am
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!

Not a problem, just glad to help. Sometimes an easy explanation is best.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: tim on February 16, 2007, 11:15:32 am
Hello Mark,

Is there a possibility to order the childs by product SKU?
i am working with php for one month now but i just can't find the solution can you help me please?

Tim
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 16, 2007, 12:34:04 pm
Hello Mark,

Is there a possibility to order the childs by product SKU?
i am working with php for one month now but i just can't find the solution can you help me please?

Tim

Hi Tim,

I have covered that in a previous post! http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg51683#msg51683 (http://virtuemart.net/index.php?option=com_smf&Itemid=99999999&topic=15697.msg51683#msg51683)

The files have changed some since then, so you'll have to search for the required lines and instead of product_id enter product_sku.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Karsten Eichentopf on February 16, 2007, 13:14:36 pm
Some german translation for your hack. Copy this into VMs german php, germani.php or germanf.php:
var $_PHPSHOP_DISPLAY_USE_PARENT = 'Die Einstellungen der Kindprodukte überschreiben und die des Elternprodukts verwenden';
var $_PHPSHOP_DISPLAY_NORMAL = 'Standard Mengenanzeige';
var $_PHPSHOP_DISPLAY_HIDE = 'Mengenanzeige verstecken';
var $_PHPSHOP_DISPLAY_DROPDOWN = 'Dropdown Box benutzen';
var $_PHPSHOP_DISPLAY_CHECKBOX = 'Check Box benutzen';
var $_PHPSHOP_DISPLAY_ONE = 'Einzelne "In den Warenkorb" Schaltfläche';
var $_PHPSHOP_DISPLAY_MANY = 'Eine "In den Warenkorb" Schaltfläche für jedes Kind';
var $_PHPSHOP_DISPLAY_START = 'Start Menge';
var $_PHPSHOP_DISPLAY_END = 'End Menge';
var $_PHPSHOP_DISPLAY_STEP = 'Schrittweite';
var $_PHPSHOP_PRODUCT_FORM_ITEM_DISPLAY_LBL = 'Anzeige Optionen';

Sounds stupid and can be made better but i hope this helps. It took some time with a file merge tool to finde the var you use. IMHO it would be better if you used an own namespace for this. Now i can really use your plugin as i finnaly understand the settings ;)

As far i can see i have to update each single product? I really would like a shop wide setting.

Thanks for your work,

Karsten
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: tim on February 16, 2007, 13:38:13 pm
Thanks Mark,

I missed this solution, i love this xlnt MOD, works perfect!

Tim
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: silexian on February 16, 2007, 18:29:34 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

Hello Macallf,

do you mean the discount or the price/quantity feature ?
Because I have set several prices to the parent ("add a price", with quantity).
and verified that the children products do not have a price set.

I have tested to add different children to the cart and the "price by quantity" feature is not applied on the whole product.

ex: I want to buy some shoes, and if I buy 2 shoes, i get them for a special price, no matter what size they are (the size is the criteria of the children products)

regards,
Silexian
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Riccardo on February 16, 2007, 18:35:12 pm
hi, first of all... thx 4 all the works you're doing!!

i have some probs:
in the admin of vm i have no text in the tab added by the mod for the child properties, i have vm and J! in italian maybe i have to change something in my language file?

when i click the addtocart button for a child item it says that the quantity is more of the stocked quantity also if i have a lot of them available in the store. how can i fix this?

I use J!1012 and vm 109 (ecommerce ed)

hope that you can help me

thx for now

edit: now i can see the text.. i added missing voices in italian.php so this part is ok

but i have a lot of problem with addtocart beacause when i click on the button it goes in  a loop and reload the same page. maybe have you talk about this in past post? i'll do a search for this now... i'm sorry if i'm repeating questions but my connection is very slow and it takes a lot of time to take a look to 26 pages...i'll try.

hope you guys can help me with this great mod. thx
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Andy on February 21, 2007, 17:11:44 pm
My admiration to macallf for the mod. It does work for me as I think it is intended to do, and very well at that.

But I did find limitations for my puposes, which reflect questions that have been put in the thread.

As others have mentioned, they would like to offer e.g. a line per t-shirt size and a dropdown for colour. Justin Z asked if he could "combine the use of child products and attribute dropdowns," which is a candidate solution to that need, and it does actually work up to a point.

For me though it won't be enough to use "attribute" dropdowns because I expect sparse product data, i.e. not all size/colour combinations are available. Even without stockkeeping on the system, every available size/colour combo needs to be in the product table as a child item, to prevent the customer ordering unavailable combinations. Each row listed must offer only the available colour combinations for that item.

On the other hand, although the data is technically 'sparse,' the explosion of combinations requires that most of the attributes drop down unless they create a price change. So size is a line and colour isn't, for example, and there are many everyday products with more attributes than this of course.

The other question that then arises is about 'Update Cart.' For me this doesn't work with combinations of list and dropdown.

Storyboard: Customer picks one XL in red and adds to cart. Customer comes back and enters two XL in blue and adds to cart. Customer comes back. What is the state of the display?
Or, to put it another way, cart state does not uniquely determine current detail display content (quantity, selected values of dropdowns) when there are many cart lines per product detail line.

 Actually, since as I say it is possible with the lister to create this story, I suppose technically this is a defect, although my argument says it's a limitation and I'm not surprised.

The examples I know of (no free advertising, but think 'clicks and mortar discount department stores with national advertising budgets') deal with this by making all posts to the cart inserts, no updates.

So you can revisit the cart adding one XL red, and each such revisit inserts a new order line. Each return to the shopping pages clears the detail page quantities for more *inserts*. The only way to update or delete picks is at the cart, not the detail page. Shoppers can happily place an order with several lines for the same product with the same or different quantity. My argument says there isn't another way.

Am I right in thinking that a) this is the situation and b) we're a bit away from being able to do this?
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 21, 2007, 17:24:52 pm
Andy,

How about trim that down and say what you mean!

Sorry, but I got confused and lost less than half way through this post.

I assume you are talking about the way the cart updates, if so more clarification would be helpful.

VM by defaul adds to the cart, each click of the add to cart adds to the cart.

However, when using a single add to cart for several items, thats not advisable. Hence the reason in that situation that the cart is updated with what ever values are on the product page at the time. (Otherwise defaulting to 1, a user would add every item to the cart once).

When coming back to a detail page that already has items in the cart, using one addtocart button, the display does reflect what is in the cart.

The other point about separating the combinations and making a pseudo drop down dependant on the attributes. That is possible, but one hell of a workload. I have, after all provided this for free and although many of you are developers and charging your customers for this I have had not one donation for doing this work from any of you.

So if you want a solution more specific to your needs, contact me and I'll give you an estimate!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Andy on February 21, 2007, 19:17:22 pm
 I've nothing but respect for what macallf has contributed and I don't mean to prompt anything but enthusiasm. Hope all can read my post that way. If people reading this thread are analysts, developers or implementers or otherwise interested in this area then my post is aimed equally at them to contribute. I don't see why anyone would assume mcallf is going to do all the work. I don't. I trust he has more than earned the right to get a reward for his expertise by whatever business model he intends.

 My argument is dense and fully-argued so it wasn't going to be any shorter, I'm afraid, although some rich text headings would have helped. The storyboard is an exact description of the situation that leads from the technical preamble and description of needs above it.
Quote
"When coming back to a detail page that already has items in the cart, using one addtocart button, the display does reflect what is in the cart."

I used attributes (as in an entry in the child item jos_vm_product.attribute field) to create dropdowns, in combination with child products with attributes (in jos_vm_product_attribute) and macallf's lister, and it doesn't reflect in those circumstances, as I describe with the t-shirt storyboard.

Quote
"each click of the add to cart adds to the cart ...when using a single add to cart for several items, thats not advisable. Hence the reason in that situation that the cart is updated with what ever values are on the product page at the time. (Otherwise defaulting to 1, a user would add every item to the cart once)"
The default would be 0. Every time you enter the page you have picked nothing yet to add to the basket. I am arguing in the general case that the detail page shouldn't be a reflection of what's in the basket. The detail posts inserts to the basket. It's one-way traffic.

Maybe I misunderstand how this board runs. Is there a thread for hacks and a thread for architecture? I thought I read that what macallf is contributing is going into the 1.1 release. If so I would like to contribute my view on how this might develop, but I seem to have offended maccalf instead. If so, sorry. Repeat, "My admiration to macallf for the mod. It does work for me as I think it is intended to do, and very well at that." But I also think that it would be good if it were able to do what I have suggested, and my view is based on a what other e-shopping does, and reading what others have said in this thread.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 21, 2007, 19:26:35 pm
Sorry for the mistake. You have now cleared a point up.

Attributes have never reflected what is actually in the cart I agree. Problem here is if there are 2 items added to the cart one with option 1 and another with option 2 what do you display as being selected?

There is a small mod to ps_product_attribute.php that will remove the quantity update on the details page, if that's what is required.

That's where the problem arises, hence I didn't change the way that works.

The original VM used to insert into the cart. Not add, but this changed recently. So I had a dilemma, do I change my mod to work totally in one way, or make it differentiate between the 2 scenarios.

I had to make choice, for the most part I believe the correct one.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Andy on February 21, 2007, 20:11:05 pm
 I understand. Thanks for the direction, maccalf.

The "small mod to ps_product_attribute.php that will I think remove the quantity update on the details page" is a good steer which will fix the anomaly I report and leave the sparseness issues for another day.

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 21, 2007, 20:19:08 pm
Attached

One modified ps_product_attribute, with the quantity update disbaled

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE (
Post by: Darren Blade on February 24, 2007, 13:57:13 pm
I get

Fatal error: Call to undefined function: get_product_attribute() in /administrator/components/com_virtuemart/html/shop.product_details.php on line 349

after extracting the file for VM 1.0.9....

Do I need to make any changes manually after extracting the file or just extracting should be enough?

I get this too...could someone explain what might be causing the problem please. J1.12/VM1.09/lateste 1.09-1 hack
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 24, 2007, 14:02:16 pm
The only thing I can offer is that it hasn't installed correctly.

The files in the zip contain several updated files to be placed in classes, one of these is ps_product_attribute.php, has the necessary function. If it hasn't been updated then it won't work.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Darren Blade on February 24, 2007, 15:02:21 pm
Thanks mark.

Third time lucky!

Not sure why it did not take the first times...gremlins perhaps!

Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Plavanie.com on February 24, 2007, 17:44:14 pm
Hi, I have a problem...

After I uploaded the files I still see dropdown list instead of the table with child products... I am sure that I updated all the files, there may be no problem in it.

I am a bit confused to see in shop.product_details.php

Quote
if($ps_product_attribute->get_product_attribute($parent_check_id,"product_list") != "YM")
        $html = $ps_product_attribute->list_attribute($product_id,$list);
    else   
        $html = $ps_product_attribute->list_attribute_list_multiple($product_id);

I thought the reason could be using list_attribute instead of list_attribute_list, and making the change really led to seeing the table instead of the dropdown box, but this table had nothing to do with the screenshots you uploaded... No buttons Add to Cart near each row, many other problems...

You may find the result with changes here: http://plavanie.com/component/page,shop.product_details/category_id,68/flypage,shop.flypage/product_id,5187/option,com_virtuemart/Itemid,89/

Please help
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 24, 2007, 18:07:28 pm
That line is actually correct and the following.

I take it you went into the product and altered the options on the new second tab. Where you set all your options.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Plavanie.com on February 24, 2007, 18:16:52 pm
I have finally found the problem.

In my case IF condition never worked and when I put identical conditions in both IF and ELSE it started working.

Why so? Maybe because I am using a language different from english?

Another problem is that price is shown twice in the table: strikenthrough and normal, though I do not have any discounts...
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 24, 2007, 18:23:11 pm
I have finally found the problem.

In my case IF condition never worked and when I put identical conditions in both IF and ELSE it started working.

Why so? Maybe because I am using a language different from english?

Another problem is that price is shown twice in the table: strikenthrough and normal, though I do not have any discounts...

I keep forgetting to put the changes back in for that!

Check this thread it tells you how to alter the file to get it to display correctly.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg67352#msg67352 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg67352#msg67352)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: Plavanie.com on February 24, 2007, 18:33:56 pm
Thanks! now it works correctly.

The only strange thing that remains is why IF did not work and I had to put the same thing in both clauses
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 24, 2007, 18:44:25 pm
Thanks! now it works correctly.

The only strange thing that remains is why IF did not work and I had to put the same thing in both clauses

Did you set products up in admin section?

If you haven't it will still display drop down hence the reason the if statements are incorrect!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity mod
Post by: mikegeo on February 27, 2007, 05:25:38 am
Hi Mark,

This is almost working for me....How can I place the attribute list on the category page with each category picture and make the attribute name in the list link to the flypage for each product.  I have entered each product and also added them to the attribute list of a subcategory of sorts.

Thanks for this mod, a donation will be in order when I get this site completed.
Title: Re: MOD: Child list instead of drop down. UPDATE (1.0.9) + store wide quantity m
Post by: macallf on February 27, 2007, 10:16:27 am
Hi Mark,

This is almost working for me....How can I place the attribute list on the category page with each category picture and make the attribute name in the list link to the flypage for each product.  I have entered each product and also added them to the attribute list of a subcategory of sorts.

Thanks for this mod, a donation will be in order when I get this site completed.

I must have my stupid head on this morning, I don't quite get what you're trying to do.

If you try explaining in more detail. Or provide a mock up image, then I'll take another look.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 06, 2007, 14:17:11 pm
Hi Again,

Another update this time for 1.0.10


Same instructions as usual

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Joe Smith on March 07, 2007, 21:24:09 pm
I've looked though this massive thread, and I cant find what I am looking for....so here I am humbly asking:

On my product page, when it is first opened, the quantity boxes all have a quantity of 1 by default.  I would like them to say 0.  Next, I would like a user to be able to add quantities for all different items, then hit "add to cart" and have ALL of the items on that page with a quantity of 1 or more added to a cart.

I thought maybe a mod with the name "store wide quantity mod" would do the trick.....but it doesnt seem to for me.

If it is suppose to or if someone could tell me where to change code to do any or all of this...please post those changes for me!

Thanks SO much!!!!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 07, 2007, 21:40:51 pm
If you are using child products and a single addtocart button thenthe default quantity will be 0 and any items with a quantity gretaer than 0 will be added to the cart. This only happens if you have child products. It does not work on the browse page only the detail page.

This is not for advanced or custom attributes that is something else.

Mark
Title: MOD: Child list instead of drop down
Post by: Loiret on March 08, 2007, 12:26:54 pm
I apologize my English is not good, and sometimes I have difficulty in understanding. I installed the patch for VM 1.09 and I use joomla 1.0.12.
But when, I wanted to change the code, I do not  find: [
Code: [Select]
function list_attribute($product_id). I found :
Code: [Select]
function list_attribute($product_id, $param = false) {
        if ($param) {
            return $this->list_attribute_list($product_id); }
        else {
            return $this->list_attribute_drop($product_id);

So,  do you think that the code was already changed?

Furthermore, in shop.product_details, the code does not correspond to the indicated lines:

line 299
Code: [Select]
else {
        $product_image = "<a href=\"$imageurl\" target=\"_blank\">".
line 305
Code: [Select]
/* MORE IMAGES ??? */ I found things which looked like but as I am not very bright, I do not prefer to touch it.
What is the problem in your opinion? Where  I made a mistake? By thanking you in advance
Mélodie
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: Lain_ on March 13, 2007, 02:22:10 am
Well after many weeks of playing with this mod in a local backup copy of my friends site and for some odd reason I cant fathom all the prices are slash through like the item is on sale...only its not.  :-\

Also, one other thing that I recently found out. When I try to use any drop down menu custom attributes on the site it will not let me use any currency red[+3.00] features?

I really need to be able to use currency on the drop down color options. Is this something wrong, or is that how the new mod works? Also can it be made to only display one drop box option that the other options "inherit" by defualt....if not I hope this featur exists as it would be exactly what I need.

My friends site is here....www.tagshirts.com (http://www.tagshirts.com/screenprinting/online-shop/281.html)
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Poiter on March 13, 2007, 13:59:50 pm
Hi,
First of all, thanks for the mod. It's really great.
But I have a few questions.
I've made a site where you can buy online prices (using joomla 1.0.12 and VirtueMart 1.0.9).
www.hacomassen.nl/hacom (http://www.hacomassen.nl/hacom)
The prices are different because of the lenght of the prices. Also you can choose an "afslag" I don't know the English word. But I have some pictures to make it clear :
Click "Kies hier uw afslag" and then a popup will appear.
http://www.poiterdesign.eu/Hacom/afslag.gif (http://www.poiterdesign.eu/Hacom/afslag.gif)
This is the pop up
http://www.poiterdesign.eu/Hacom/afslagen1.gif (http://www.poiterdesign.eu/Hacom/afslagen1.gif)
There about 150 different "afslagen" I fixed it with a popup where you have to choose the number of "afslag" you like en then select the number with an dropdown button.
Is there a possibility too use radiobuttons on the popup, so you can choose your "afslag" right away and don't have to do 2 unneccesary things.

Second question. Also you can write a text that will appear on the price when you order. But I nead 3 rows with an limit of characters for each child item. At the moment I only know how to make 1 row for each child and cannot make a limit for the characters.
Character at the "graveertekst" ;
http://www.poiterdesign.eu/Hacom/graveren.gif (http://www.poiterdesign.eu/Hacom/graveren.gif)
Also when you don't write a text, you cannot order any prices. You need to fill in this. I can solve it ,with the mark that people who don't want text, the need to write "nothing" in the field. But that's not really friendly for customers.
Is there an solution for this.

Maybe difficult questions, but it would be really great if someone can help me with this. The question with the popup isn't the important one, but with an sollution it makes the usability much better.

Thank you very much in advance

Poiter
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 13, 2007, 14:40:59 pm
Calibrated

The striked out prices, I forgot to put in the fix to remove it from normal prices and this has been asked many times in this thread.

Please check here on how to fix it http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg67352#msg67352 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15697.msg67352#msg67352)

The attributes do still show the currency, I have not changed how this works at all!

Check here and you can see it working. This is J! 1.0.12 and VM 1.0.10 and my mod with no changes to the files.

http://development.markcallf.co.uk/index.php?page=shop.product_details&flypage=shop.flypage&product_id=1&category_id=1&manufacturer_id=0&option=com_virtuemart&Itemid=26 (http://development.markcallf.co.uk/index.php?page=shop.product_details&flypage=shop.flypage&product_id=1&category_id=1&manufacturer_id=0&option=com_virtuemart&Itemid=26)

The probelm with having one drop down box is that all products would inherit that attribute, most people would not need this, in fact they would need it to be the way it is.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 13, 2007, 14:58:59 pm
Poiter,

These are actually nothing to do with this mod but standard virtuemart features.

Somebody has posted a hack to allow radiobuttons for attribute selection, but I wouldn't know how to do it in a popup and return the info to the shop page!

The second one is a simple fix.

in shop.cart you will find this line

if ( ($result["attribute_given"] == false && !empty( $result["advanced_attribute_list"] ))
          || ($multiple_products == 1 && ($result["custom_attribute_given"] == false && !empty( $result["custom_attribute_list"] ))) ) {

change this to

if ( $result["attribute_given"] == false && !empty( $result["advanced_attribute_list"]  )) {

This removes the check for an empty field.

The size of the field is set in ps_product_attributes. function list_custom_attributes

You would have to change this line from

$html .= "<input type=\"text\" class=\"inputbox\" id=\"".$titlevar."_field\" size=\"30\" name=\"$titlevar$prod_index\" />";

to

$html .= "<textarea  cols=\"40\" rows=\"3\" class=\"inputbox\" id=\"".$titlevar."_field\" size=\"30\" name=\"$titlevar$prod_index\" /></textarea>";

Obviously change the cols and rows to suit your needs.

I hope this help

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: John - Australia on March 13, 2007, 16:03:06 pm
Hi
Can you point me in the right direction to bring back the 'Usually ships in' text. I need to bring this back for each parent. All child items have the same 'usually ships in' parameter, but I am not sure where to look for the code

John
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 13, 2007, 16:26:55 pm
Hi John,

that is done in ps_product.php

show_availability. VM checks to see if the product has children, if it has it doesn't return anything. You would have to modify this part to work the way you want.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Lain_ on March 13, 2007, 16:58:47 pm
Quote from: Mark
The attributes do still show the currency, I have not changed how this works at all!

Sorry to say Mark..but your example website, which has the exact same attribute drop menu does not work just like mine. The problem is, as an example on your site when you select a product...I used the shovel on your site as an example.

So the base price is $5.40 for the "small" shovel..then you have a drop down below that to select "options"..so I select the XL+1.99 option and add to cart. The total amount should reflect a price of $7.39 ($5.40 base price +$1.99 option =$7.39)

But just as on my site, and yours the price in the cart is still only the base price. Thats a problem I need to resolve before I can use this awsome mod.
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: macallf on March 13, 2007, 20:22:52 pm
Quote from: Mark
The attributes do still show the currency, I have not changed how this works at all!

Sorry to say Mark..but your example website, which has the exact same attribute drop menu does not work just like mine. The problem is, as an example on your site when you select a product...I used the shovel on your site as an example.

So the base price is $5.40 for the "small" shovel..then you have a drop down below that to select "options"..so I select the XL+1.99 option and add to cart. The total amount should reflect a price of $7.39 ($5.40 base price +$1.99 option =$7.39)

But just as on my site, and yours the price in the cart is still only the base price. Thats a problem I need to resolve before I can use this awsome mod.

That was because the method for checking advanced attributes has changed!

This took me a while to sort out, but thank you for pointing that out (It also causes a problem in VM1.1!)

I have updated all the files and attached here. (The change was only ps_product_attribute, so you could just replace that one!)

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: dj4967 on March 17, 2007, 09:16:20 am
This is biazzare...I installed the new Mod...made the list with add to cart on each child. Worked fine. I would add item and it would stay on the product description page stating tht it added fine.

THen for some reason it now goes to the cart instead of staying on the products page with the childs.

Wht happened?

Thx
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Doug Hicks on March 20, 2007, 18:07:31 pm

Mark, Installed this hack and works fine.
Question: Can you make the parent details show only once, instead of on each child product.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: Riccardo on March 21, 2007, 09:16:17 am
hi all, i would like to know if it is possible to do this:
i have a parent product and in its detail page i can see the list of chil items with their attributes, prices etc.

i usually use the list instead of the dropdown and with no link to the child item detail page, i need them in a list in the parent prod. flypage but...

is it possible to have the availability shown as the attributes for each item?

like this:

|availability|Prod.Name|Attribute list|Price|Quantity|AddtoCart|

hope this is clear enough 'cause  my site is offline yet and i have no link now.

i like this mod a lot but i need this modify so i hope you guys can help me.

i thank you
Ricky

Peace!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 21, 2007, 13:26:51 pm
In the code there is already a stock level addition. This displays the current in stock quantity.

In ps_product_attribute.php you will find these lines (they appear twice)

/Product Stock Level Addition
                //
                if($local_shop) {
                    $html .=  "<td align='right' width='5%'>";
                    $html .= " " . $db->f('product_in_stock') . "</td>";
                    $columns++;
                //
                //End of stock Level
                }

if you remove the code in red it will display the current stock level.

You may have to move this further up the code to suit your requirements.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: Riccardo on March 21, 2007, 13:37:03 pm
thank macallf for the quick reply, now i try the modify. thanks again and compliments for the mod you made!!

Peace!
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Riccardo on March 21, 2007, 16:06:10 pm
i'm sorry macallf but maybe i didn't understand very well the instruction because nothing happen. i deleted the red code but no success, i tried to move the rest of the code up and down but i don't know where to put it so i can't see the availability.

can you help me again? thanks mac

Peace!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: excogitation on March 22, 2007, 00:28:24 am
Will this Mod be integrated into a future version of VirtueMart?
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: deneb on March 22, 2007, 00:31:19 am
Will this Mod be integrated into a future version of VirtueMart?

yep
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 22, 2007, 00:31:39 am
I think I have mentioned several times that this is a standard feature of VM from V1.1


Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: excogitation on March 22, 2007, 00:47:32 am
Yeah, I thought I read it some time ago,

I was just checking the bugtracker and roadmap but couldn't find it.

I also tried the forum search ... thanks - now I know for sure.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 22, 2007, 00:50:56 am
My Demo site,

No where near finished but this site gives an idea of what is possible Mark Callf Photography (http://photography.markcallf.co.uk/shop/product_details/photo.tpl/macro_1/h02_6.html)
The cart is styled by just altering the template system, the js by  adding to the theme.js and some other mods I am working on to integrate gallery2.

Just gives you an idea of what is possible using VM1.1

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: Poiter on March 22, 2007, 13:41:00 pm
Hi Mark,

First of all, thank you for the fast reply. And sorry for the late response on my side. I were very busy and didn't had the time to come back. Apologise.

The change of the textarea went great, but only one thing.
I need a limit of characters, customers can type e.g. 25 for each row. I made the cols 20 and the size also 20. Now you can type 25 characters for some products, but for other products you can type only 15 and he skips to the second row.
Also after the 3th row you can type on and on, there's no limit.
How can I solve this?

Second the "check for an empty field"

in shop.cart you will find this line

if ( ($result["attribute_given"] == false && !empty( $result["advanced_attribute_list"] ))
          || ($multiple_products == 1 && ($result["custom_attribute_given"] == false && !empty( $result["custom_attribute_list"] ))) ) {

change this to

if ( $result["attribute_given"] == false && !empty( $result["advanced_attribute_list"]  )) {

This removes the check for an empty field.

I didn't find the line in the shop.cart but find it in ps_cart. In ps_cart I changed the line, but it didn't work. When I  type nothing, the cart won't be updated. Please can you help me again?
This the site; http://www.hacomassen.nl/hacom (http://www.hacomassen.nl/hacom)

Thanks in advance for you're help

Gr. Poiter
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Jerker Lundin on March 22, 2007, 14:17:21 pm
Is there a way to multiply one attribute with an other?

I would like my customers to add a measure for heigt and a measure for width and then have this calculated as quantity.

eg 10 millimtre X 10 millimetre = quantity 100 squaremillimtre.

I would be grateful for a reply if it´s possible and if that´s the case some guidings in how and where I can change code to make this work.

I have spent the last month trying to figure this out and now I don´t know how to solve this problem.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 22, 2007, 15:15:22 pm
Poiter,

that mod to ps_cart (sorry that is the correct file) should work! It removes the test to see if the custom attrib field has been filled in.

the other I'll look into.

Jerker Lundin

Attribs can not be multiplied together without using some js to update the quantity field. This is a specific requirement and not something I can include in this mod for general release.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Jerker Lundin on March 22, 2007, 16:31:35 pm
OK!

Thank you for your reply!

I understand that you can´t do this as a request. And there is no problems with that. I hope that asking for help is not a problem either.

Regarding to your reply Macallf I asume that it can be done. Is that correct? And can you point out what file to imlement the JS code or if it must be in a separate file?

I am as I said before grateful for any help and it is indeed much more satisfying to "fix" things like this by myself, but sometimes it will not work and there is no light at the end of the tunnel  ;)
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: John - Australia on March 25, 2007, 08:15:19 am
Hi
Many thanks - I deleted
$is_parent = $this->parent_has_children( $prod_id );
      if( !$is_parent )

in ps_product.php (about line 2467) and this restored it.
seems to work fine
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: saffrongeek on March 27, 2007, 07:47:05 am
Hi,

    Wishes to all here.

    I am looking how to make this as shown in this link.... a new bie .. Hope experts here would be patient enough if i missed to read any thread.

   http://www.minkblanketsrus.com/component/page,shop.product_details/flypage,flypage/product_id,78/category_id,/manufacturer_id,/option,com_virtuemart/Itemid,26/

With regards and thanking in advance
Saffron
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: excogitation on March 27, 2007, 08:02:24 am
If you could specify what exactly you're trying to figure out
someone might be able to help you.
Hi,

    Wishes to all here.

    I am looking how to make this as shown in this link.... a new bie .. Hope experts here would be patient enough if i missed to read any thread.

   http://www.minkblanketsrus.com/component/page,shop.product_details/flypage,flypage/product_id,78/category_id,/manufacturer_id,/option,com_virtuemart/Itemid,26/

With regards and thanking in advance
Saffron
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Kenneth Chin on March 29, 2007, 00:39:37 am
Hello,

i just installed the following updates to the most recent ecommerce version of virtuemart (vm 1.0.10, joomla 1.0.12):

ChiList 1.0.10 and Chillist 1.0.10-1.

i am not able to see lists for products, i still see drop-down box

am i doing something wrong?

are the code modifications indicated on page 1 of this post require3d to be made or are they included in Chillist 1.0.10 and 1.0.10-1?

thanking all in advance for any assistance
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 29, 2007, 00:46:17 am
each product has to be changed to enable lists, it doesn't just replace the dropdown.

When you edit a product you will have a new second tab, display options. Here you specify the child list display type. Without changing anything, you get a dropdown; select one add to cart and you have one add to cart for all child products;multiple add to cart, you have an add to cart for each child product.

Please be aware, this only affects child products not attributes, that is something completely different.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on March 29, 2007, 16:08:26 pm
Attached is a mod for Suzan Marie Chin but others may find it useful.

This mod to my mod will show child products on your browse page but not the parent.

Three files are modified

extract the included file to your-site/administrator/components/com_virtuemart

it will ask to overwrite files in the classes and html subdirectory.

The browse_query file is altered to select all products including children apart from specified ids
The shop.browse file is altered to return a list of product ids with children (These are the parent ids to be excluded from the query above)
and last ps_product has a new function to find the parent ids in the current category.

I haven't fully tested it in all situations but it does work with the test data.

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 14, 2007, 09:26:16 am
SOS!

I have a localhost install of the latest Joomla_e-commerce pack (Joomla 1.0.12 + VM 1.0.10).

I am looking for a way of replacing child drop-down box with explicit child list display.

I have downloaded the child_list1010-1 set and replaced every respective file in the install with the files contained in child_list1010-1.

Now I am trying to add a product with a set of child products to see if they will display correctly.

Here's where the trouble starts. I select a product from the product list and try to create a child product by clicking the New icon. The Add a Product form opens - but on top it says,

Warning: Illegal offset type in \administrator\components\com_virtuemart\classes\ps_product.php on line 1256

Warning: Illegal offset type in \administrator\components\com_virtuemart\classes\ps_product.php on line 1281

Warning: Illegal offset type in \administrator\components\com_virtuemart\classes\ps_product.php on line 1284

I have seen a similar complaint on Page 18 of this forum - however, I could not figure out how this issue was solved.

If I ignore the warning and proceed with the product creation, the moment I save the child product I get the following message: ERROR: A product ID is missing.

I have also downloaded child_on_browse-1 - but did not load it as it uses its own version of ps_product.php file which I have already changed.

I am totally confused. What am I doing wrong?

Urgent help needed!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 14, 2007, 11:02:48 am
The parent product must have an attribute added and you must be on the parent products edit screen to create children.

i.e. open product, add attribute, save attribute, go back to main product - must be on edit screen, select new item icon. This will create child product.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 14, 2007, 13:40:48 pm
Done as you suggested. Cloned a product; added an attribute (not that I can understand the purpose of adding an attribute: why do I need using attributes if I just wan tto create several child products, each one with its own set of properties?!), saved, returned to Edit Product view.

No New button. Just no button!

Where do we go from here?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 14, 2007, 14:11:47 pm
Wow. Sorted this one out as a woraround:

there is no New button - but in Edit Product view, Products ==>Current Product ==> Add Item is another way of accessing Add Child Product form.

Ooopsie...

Now after closing and reopening the parent product, there IS a New Item button... Go figure...

Sorry to be such a bother folks; it seems everything is working fine now, and I have been able to create three child products that appear as a list in the Product Browse page. thanx to everyone for reading - let me know if you need help on creating a child product list, and I will walk you through.

Extra thanx to Mark.

Cheers -

L
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 14, 2007, 14:47:30 pm
I guess I got too happy too early.

Started adding another product. Added what is supposed to be a parent product; tried adding a chile product - no go again. No New button and no Products ==>Current Product ==> Add Item path either. I'm stuck again.

Mark, can you sort this one out? I am obviously doing something wrong, and it must be pretty stupid - but I cannot figure out what it is. I keep going in cirlcles trying to catch my own tail...  >:(

Lev
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 14, 2007, 16:20:14 pm
To create child products

1. Create parent product and save
2. Edit product and click icon 'add attribute' - This is what distinguishes each child from the other e.g. size or colour or size and colour, you can add more than 1 attribute to the parent product. DO NOT CONFUSE THIS WITH ADVANCED ATTRIBUTES on the product status tab.
3. Save attribute
4. Go back to parent product, you will now have the 'new item' icon, this will create your first child product.
5. At the bottom of the 'product status tab' you will see a new item or items, which are the attributes you created in the second step, You must enter something here!
6. Save you r child product and go back to the parent and click 'new item' to crreate the rest etc.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 14, 2007, 22:29:49 pm
Got it; works fine both on localhost and at the server. thanx!

Now the spoiler. I do NOT need attributes. The parent product is a textbook. The child products are an answer key, an audio CD and/or a cassette tape. What I need is the following product structure:

Parent product: textbook title.
Child products:
-textbook
-answer key
-audio CD.

These three do not seem to have any common parameter that could be declared an attribute... :(

Does it mean that using child products is not for me and I will be better off using categories and subcategories and "Related Products"? Or is there a way of disabling the validation mechanism that requires the presence of at least one attribute before child products can be added?

TIA -

L
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 14, 2007, 23:00:25 pm
Use a bit of common,

I would use Format or Type. And remember You can not buy the parent product either! This would be another child. e.g. Format : Text Book,Answer Key,Audio CD, Cassette Tape

It's not that difficult surely!

Mark
Title: Re: MOD: Child list instead of drop down.1.10.1
Post by: John - Australia on April 16, 2007, 09:13:18 am
Hi
I have installed this but have lost the strike out price/discounted price feature for products without child items
Where a product is a single parent, I need to show the Gross price struck out, and then the discounted price where it shows the qty box and add to cart.

How can I get this back
John
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 16, 2007, 11:45:43 am
That I have not changed. I just made alterations to the child products!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: John - Australia on April 16, 2007, 12:02:32 pm
Hi
I upgraded from 1.0.7.where a single product with no children doesn't show prices next to the qty box
I either need too show the gross price struck out, and the discount price, or no price at all.
Where do I look

John
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 16, 2007, 12:20:32 pm
Sorry John, you were dead right!

In shop.product_details.php look for this section of code

$price = "";
        if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
            $price = $ps_product->get_price($db_product->f("product_id"));
            if( $_SESSION["auth"]["show_price_including_tax"] == 1 && $price) {
                $tax_rate = 1 + $ps_product->get_product_taxrate($db_product->f("product_id"));
                $price['product_price'] *= $tax_rate;
            }
            $addtocart .= "<td align=\"right\">".$CURRENCY_DISPLAY->getFullValue($price["product_price"])."</td>";
        }

and replace it with this

$price = "";
$actual_price = "";
       if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES) {
            $price = $ps_product->get_price($db_product->f("product_id"));
            $actual_price = $ps_product->get_adjusted_attribute_price($db_product->f("product_id"));
            if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                $tax_rate = 1 + $ps_product->get_product_taxrate($db_product->f("product_id"));
                $price['product_price'] *= $tax_rate;
                $actual_price['product_price'] *= $tax_rate;
            }
            $addtocart .= "<td align=\"right\">";
            if($price['product_price'] != $actual_price['product_price']) {
                $addtocart .= "<span style=\"color:red;\">\n<strike>";
                $addtocart .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."</span></strike>&nbsp;";
                $addtocart .= $CURRENCY_DISPLAY->getFullValue($actual_price["product_price"])."&nbsp;";
            }
            else {
                $addtocart .= $CURRENCY_DISPLAY->getFullValue($price["product_price"])."&nbsp;";
            }
            $addtocart .= "</td>";
        }

That will sort it out!

I will make sure this is included in the next version!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) price
Post by: John - Australia on April 16, 2007, 12:34:17 pm
Hi
found it at line 379- fixed and working like a dream
Your help is invaluable
John
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Radek on April 20, 2007, 00:52:09 am
Hello!

I found the shop.product_details.php but I can't find the code you mentioned :(
Is it the files located in administrator/components/com_virtuemart/html ?

My problem is that only net price is showing :(
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: John - Australia on April 20, 2007, 02:47:51 am
Hello!

I found the shop.product_details.php but I can't find the code you mentioned :(
Is it the files located in administrator/components/com_virtuemart/html ?

My problem is that only net price is showing :(
Hi
it is in
administrator/components/com_virtuemart/html/shop.product_details.php

at about Line 379 after
// If this is not a list and has no children display the standard page (handles drop down as well)   
   if (!$list || $nochilds ) {
        $bgcolor=SEARCH_COLOR_2;
        $addtocart .= "<input type=\"hidden\" name=\"prod_id[]\" value=\"$product_id\" />\n
        <input type=\"hidden\" name=\"product_id\" value=\"$product_id\" />\n
        <input type=\"hidden\" name=\"parent_id\" value=\"$product_id\" />\n
      <table width=\"100%\" style=\"vertical-align: middle;\" class=\"child_list\">
        <tr style=\"vertical-align: middle;\" >";
        $addtocart .="<td align='left'>".$db_product->f("product_name")."</td>";
        if($db_product->f("product_unit")) {
            $addtocart .= "<td>".$db_product->f("product_unit")."</td>";
        }
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 20, 2007, 07:00:49 am
Folks,

I have installed the child_prod mod, played with it and found it unsutable for our purposes (we have sets of a textbook/answer key/audio cassette as products - this is not a parent/child arrangement), so we decided to abandon the idea and return to "standard." I replaced the modded files with the original files, back to Square One. :)

At the moment, we use Attributes to merge three levels of the same textbook (beginner/intermediate/advanced), and it works OK for us.

However, I liked two things:

1. The ability to display products as a list, not as a drop-down.
2. The ability to prevent VM from showing the cart after the product has been added (you know what I mean: you add a product, but you don't see the cart content at once - you can continue shopping from the same product page, then request to show the car and complete the order).

The question is:

how can I reconfigure VM to display products this way?

TIA -

L
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 20, 2007, 11:16:35 am
Easy, use the mod but dont use child products!

It doesn't interfere with out the rest of the shop works. In fact, if you want to use drop downs for childlist as per normal you can.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Lev on April 20, 2007, 13:25:00 pm
Mark, hi again and thanx again for your prompt response.

There is one feature (should I call it a bug?) that seems to be interfering with using the mod.

Please review the attached graphic; pay attention to the word "Material ()" that appears under the product name I made it more visible by adding an oval around it).

In order to create a child product I need an attribute, right? Well, I added a dummy attribute Material which made it possible to create several child products. All looks great - except for the shopping cart. The attribute (or, rather, the NON-attribute) is quite confusing.

So - I would LOVE to use the mod if I only knew how to get rid of this "attribute" in the shopping cart.

OK, suppose I reupload the mod. We are now using Levels as attribute (beginner/intermediate/advanced). How can I use the mod so as to:

1) display the products as a list, not as a drop-down:
Book X Level A |Add to Cart|
Book X Level B |Add to Cart|
Book X Level C |Add to Cart|

2) can it be done WITHOUT declaring these levels as CHILD products - just using the attribute (Levels,A,B,C)?

I hope I am making sense (unless the answer is quite obvious and I am simply missing something).

TIA -

Lev

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 20, 2007, 13:58:55 pm
If you specify an attribute to create a child product you should enter something!

So for each child product, using your example, The title would be Book X and the attribute(Which is now called Levels)  would have values of beginner, intermediate and advanced.

Then when you add an item to the cart it would be Book X Level:Beginner etc.

The standard attributes(also called advanced attributes) as on the status page can not be used to do this. This mod was not designed to do that. It is just for child products.

Mark





Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: hobartimus on April 26, 2007, 18:01:24 pm
Can you tell me how to make the child product sort by SKU?

I have tried applying the fix posted here but it has no affect...
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=17526.msg55297#msg55297
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on April 26, 2007, 18:07:45 pm
You have to edit ps_product_attribute.php
on these lines

229,241,436,447,628,638

and to each query add ORDER BY product_sku

These are the queries for list with one addtocart button, list with multiple addtocart button and finally the dropdown list.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: hobartimus on April 26, 2007, 19:18:32 pm
Ah! Apparently I missed lines 229 and 241. Seems to be working fine now. Thanks!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: EZToms on May 03, 2007, 18:39:29 pm
Hello,

Congratulation for this great hack. I have installed it without trouble and it works very nicely.

I have a few questions :

- Where can I find the list of added VAR in english.php as I would like to make the translation to another language, french.

- I'd like to have a list of child thumbnails, I've searched a lot in the forum, but haven't find the solution. I'm pretty sure you hack can be modified for this. I want to do a color picker in the spirit of this site http://www.purlsoho.com/purl/products/yarndetail/801 If you have some direction to help me out, that would help a lot.

Thanks,

Thomas

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 03, 2007, 18:43:04 pm
I haven't got a definitive list of the language vars and to my shame i think some of them are hardcoded!

Sorry, but they are only in the backend.

All the formatting for the child lists is done in ps_product_attribute.php

2 functions list_attribute_list and list_attribute_list_multiple

This is where you would have to put the image links

Mark

just done a quick check these should be all the language vars

    var $_PHPSHOP_EMPTY_YOUR_CART = 'Empty Cart';
    var $_PHPSHOP_CART_DOWNLOAD = 'Download';
    var $_PHPSHOP_CART_UPDATE_TEXT = 'Upadte Cart';
    var $_PHPSHOP_PRODUCT_FORM_ITEM_DISPLAY_LBL = 'Display Options';
    var $_PHPSHOP_ADMIN_CFG_SHOW_CART_ON_ADD = 'Dont show cart on add to cart';
    var $_PHPSHOP_ADMIN_CFG_SHOW_CART_ON_ADD_EXPLAIN = 'If you select this the cart is not displayed when you add a product.';
    var $_PHPSHOP_DISPLAY_USE_PARENT = 'Override Child products Display Values and use parents';
    var $_PHPSHOP_DISPLAY_NORMAL = 'Standard Quantity Box';
    var $_PHPSHOP_DISPLAY_HIDE = 'Hide Quantity Box';
    var $_PHPSHOP_DISPLAY_DROPDOWN = 'Use Dropdown Box';
    var $_PHPSHOP_DISPLAY_CHECKBOX = 'Use Check Box';
    var $_PHPSHOP_DISPLAY_ONE = 'One Add to Cart Button';
    var $_PHPSHOP_DISPLAY_MANY = 'Add to Cart Button for each Child';
    var $_PHPSHOP_DISPLAY_START = 'Start Value';
    var $_PHPSHOP_DISPLAY_END = 'End Value';
    var $_PHPSHOP_DISPLAY_STEP = 'Step Value';
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: EZToms on May 04, 2007, 00:14:00 am
Thanks for your quick answer,

I'll make the translation from what you've given me. and try to see what's missing from there.

Hardcoded... bouuuh ;)

Does anyone maintain localisation of your mod btw ?

I love your photograph site, shows a lot of what can be done, very nice.

I'll try to dig more to achieve what i want to do. thanks for the help.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 04, 2007, 01:35:41 am
I don't think anybody has kept up with localization! Which is a shame. All i Can say that is this is built into VM1.1 as standard, and all strings are in the language files, so translations are hopefully up to date.

I'm glad you like the photography site, I hope it demonstrates what is possible with VM.

I'll try to remove all hardcoded strings for the next release of VM 1.0.x

As you can understand for such an involved mod there is a lot to maintain and sometimes I miss things. I hope you will bear with me!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Kay on May 04, 2007, 10:23:12 am
Really awsome add-on this!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: EZToms on May 04, 2007, 10:56:47 am
Updated my language file, looks ok.

See joined the missing translation in admin just for info, now I have text everywhere which is fine for me.

I have a small comment, when You use add to cart for each child, you have "add to cart" displayed, but if you have only one add to cart on the bottom, you have "update cart" which isn't very clear if the cart is empty.

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: Benny on May 04, 2007, 17:42:50 pm
Hello Mark,

I am still searching for a post with the installation instructions. Maybe you can post it for me please?

Until now I tried to replace my root/amdinistrator/components/com_virtuemart with your data but then I didn´t see any more products on my page.

Would be great if you can give me short link.

Thanks
Benny
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 04, 2007, 18:09:07 pm
Hello Mark,

I am still searching for a post with the installation instructions. Maybe you can post it for me please?

Until now I tried to replace my root/amdinistrator/components/com_virtuemart with your data but then I didn´t see any more products on my page.

Would be great if you can give me short link.

Thanks
Benny

That is all there is to it.

Unzip and overwrite the files in root/administrator/components/com_virtuemart

i.e. when it asks to overwrite select yes.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 04, 2007, 22:48:04 pm
Updated my language file, looks ok.

See joined the missing translation in admin just for info, now I have text everywhere which is fine for me.

I have a small comment, when You use add to cart for each child, you have "add to cart" displayed, but if you have only one add to cart on the bottom, you have "update cart" which isn't very clear if the cart is empty.

I have attached a new language file and a new product.product_form with the new language vars set

which are

    var $_PHPSHOP_DISPLAY_USE_PARENT = 'Use Parent Settings';
   var $_PHPSHOP_DISPLAY_LIST = 'List';
    var $_PHPSHOP_DISPLAY_LIST_DESCRIPTION = 'Use List box for child products';
    var $_PHPSHOP_DISPLAY_LIST_STYLE = 'List Style';
    var $_PHPSHOP_DISPLAY_TABLE_HEADER = 'Display Table Header';
    var $_PHPSHOP_DISPLAY_CHILD_LINK = 'Link to child product from list';
    var $_PHPSHOP_DISPLAY_QUANTITY = 'Quantity';
    var $_PHPSHOP_DISPLAY_DROPDOWN_VALUES = 'Drop Down Box Values';


I hope this helps with your translation

Mark

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: EZToms on May 05, 2007, 01:35:30 am
 :o :o

Thanks a lot, you'll try that and tell you how it goes.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: GollumX on May 12, 2007, 17:15:12 pm
Hi, is there a tutorial somewhere for this mod/hack?

I'm not looking forward to reading the 32 pages of this thread.

The very first post gives links to a zip that i assume must be uploaded to the com_vm folder.

Then it gives some instructions on how to edit some files... no mention of whether we have to make those edits or are they all covered by the hack we must upload.

After uploading, then what? How do i create these child products?

Please help.


................................
Thanks for the great hack macallf. You, Joseph, Soeren, and the other folk here are an asset to the Joomla community. Thanks.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 12, 2007, 17:34:19 pm
You just overwrite the files, nothing to edit.

Creating child products is discussed in the VM manual, no change there.

There is a new display options tab when setting up products. This is where everything is set and is quite self explanatory.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: GollumX on May 13, 2007, 14:45:37 pm
I figured as much macallf. sorry, it was 3am and the frustration was too much.

I did that and saw the new tab. But how do i actually create the new 'child' products? There didn't seem to be anywhere to create the child products, only a tab to configure how it looked.

TIA

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 13, 2007, 14:53:52 pm
Creating child products is a standard VM function and is discussed in the VM manual. It also has its own forum thread.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 14, 2007, 16:10:41 pm
I now have a site where this mod can be seen working in its different formats and also includes configuration and installation instructions. It will also hold the current files.

It's nearly complete but is still ongoing. It has it's own forum too, as this thread is now too large to maintain. So individual posts can be entered and it will be easier to see/search other posts.

Mark Callf Design (http://design.markcallf.co.uk/)

This is also in my sig.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: terry on May 14, 2007, 20:19:24 pm
Hi Mark,exellent job!
I have an request:
Is it possible to apply an image to each child?
Thanks in advance,terry
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: EZToms on May 14, 2007, 20:34:31 pm
Yes, just go to the child product page.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Steve Mailleux on May 21, 2007, 15:01:26 pm
Hello to all,

I have to thanks Mark a lot for his mods, and all of you that finally were contributors too !
I'm still in Joomla 1.0.11, VM 1.07 and Joomfish 1.7

I have actually a problem with the mod and Joomfish.
Using the contentelement vm_product_attribute_by_SKU, I'am able to translate the attribute names.  When there is no translation, then the list displays the column, the attribute in the original language and the values (image A->1) But if a translation exists then it does not appear in the Header in the display list (image A->2). And all the column is then skipped, the values for this attribute are not displayed.
I think that that the bug is in the way the html code to display the header is buit, because when adding a child in the cart, the attribute is well displayed in the original language if the translation does not exist (image B->1), or in the translated language if it exists (image B->2).

Mark, could you please have a look at that, or has anybody else already corrected the code ?

Thanks in advance.



[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 21, 2007, 15:15:50 pm
I'm not doing anything different!

The attributes are output from the DB and paced into the html. The same way the drop down is created. I don't use JoomFish so I can't comment on how it works, but I thought it just intercepted the database calls and if a translation is available return the translated version.

From your images it looks as though it is not returning the field at all, which would truncate the table. More Joomfish than my mod, I would say.

Mark
Title: Childlist on child product detail page
Post by: EZToms on May 21, 2007, 16:50:09 pm
Hello Macallf,

Is it possible to display the full childlist when you're on a child page? I only have the child which I'm on.

Regards,

Thomas
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 21, 2007, 16:57:37 pm
The whole concept of the childlist was to display all children at once without changing pages. Some uses asked for the child to be displayed individually.

It will be a lot of work to change it again to show all the children when on an individual child page.

Not something I am prepared to do.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: Steve Mailleux on May 21, 2007, 17:22:03 pm
Thanks for your lookup, Mark.

So, does anybody uses Childlist with translated attributes with Joomfish ?
Or could someone make a test to help the debugging ?

Regards,

Steve
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: EZToms on May 21, 2007, 17:29:03 pm
The whole concept of the childlist was to display all children at once without changing pages. Some uses asked for the child to be displayed individually.

It will be a lot of work to change it again to show all the children when on an individual child page.

Not something I am prepared to do.

Thanks macallf, I'll digg into the code a bit.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: terry on May 23, 2007, 14:52:12 pm
hi,
i need to add the word "stock" in the field indicated from the arrow in the attach image.
Thanks in advance,terry.


[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 23, 2007, 15:45:27 pm
Add it into the th section of the mod, you have obviously changed part of it to display stock. Near the beginning of the function will be a routine to display header. Add it there.

MArk
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: hobartimus on May 23, 2007, 16:02:39 pm
hi,
i need to add the word "stock" in the field indicated from the arrow in the attach image.
Thanks in advance,terry.


How did you add the "Stock" info? I need to do that for one of my stores.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: terry on May 23, 2007, 16:46:32 pm
Thank Macallf for you reply,
Quote
Add it into the th section of the mod
I cannot find the th section.

Quote
you have obviously changed part of it to display stock
I  haven't  made any modifications

the previous output is only the result of this setting ( image attach-child.jpg)
Cheers,
terry

p.s.
I have also installed "Lightbox + more images hack 1.0.10"
Joomla version:        Joomla! 1.0.12 Stable
VirtueMart version :   VirtueMart 1.0.10

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 23, 2007, 17:26:34 pm
Stock level is not displayed by default. The code is there for an extension to the childlist that I haven't finalised.

If the stock level is showing then some files have been altered to show them.

ps_product_attribute.php

line 364

                //Product Stock Level Addition
                //
                if($local_shop) {
                    $html .=  "<td align='right' width='5%'>";
                    $html .= " " . $db->f('product_in_stock') . "</td>";
                    $columns++;
                //
                //End of stock Level
                }


and line 278

                    if ($local_shop)
                        $html .= "<th>Stock</th>";

to enable it just remove the lines highlighted in red

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: hobartimus on May 23, 2007, 17:44:19 pm
Is there a way to have it show product availability?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 23, 2007, 17:48:18 pm
Is there a way to have it show product availability?

You could, but the graphics would play havoc with the display formatting. That's why I haven't included it. But feel free to modify to your hearts content.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: hobartimus on May 23, 2007, 17:55:39 pm
What about just including any text that is put in the "Availability:" field for the product?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 23, 2007, 17:56:36 pm
Like I said, feel free to modify.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: terry on May 23, 2007, 18:25:16 pm
Quote
ps_product_attribute.php

line 364

                //Product Stock Level Addition
                //
                if($local_shop) {
                    $html .=  "<td align='right' width='5%'>";
                    $html .= " " . $db->f('product_in_stock') . "</td>";
                    $columns++;
                //
                //End of stock Level
                }


and line 278

                    if ($local_shop)
                        $html .= "<th>Stock</th>";

THANKS MACALLF :-*
WORK
YOU ARE EXTRAORDINARY
terry

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 23, 2007, 18:40:09 pm
THANKS MACALLF :-*
WORK
YOU ARE EXTRAORDINARY
terry

You are welcome, feel free to donate, it helps keep the support going  ;D.

All my mods are now on my website, complete with a support forum and installation instructions.

I am thinking of locking this thread and moving everything over. This thread is huge and becoming impossible to manage.

Mark

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: mari dansk on May 28, 2007, 18:46:40 pm
Hello

is the "Override Child products Display Values and use parents" option doing anything?
I need to have the child products with other options but they are all disabled!
only quantity is active but the changes made there doesn't appear in the site

am i doing something wrong?
thanks 
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on May 28, 2007, 18:53:25 pm
If you click override child products...(in the parent product), the parents values are used and not the childs. Unchecking this will enable the child products to show their individual quantity options.

You can not set a child to use drop down, list etc as it is not a parent.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: mari dansk on June 05, 2007, 00:29:31 am
thank you for your reply, i got it now.

is there a possibility to use * (multiply) in the "Attribute List" ?

like this:
Examples for the Attribute List Format:
Size,XL[*1.35],M,S[-2.99];

for the product to have the price biger by 35% for the size XL

i guess the ps.product.php needs to be modified a bit

thanks
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on June 05, 2007, 01:29:00 am
thank you for your reply, i got it now.

is there a possibility to use * (multiply) in the "Attribute List" ?

like this:
Examples for the Attribute List Format:
Size,XL[*1.35],M,S[-2.99];

for the product to have the price biger by 35% for the size XL

i guess the ps.product.php needs to be modified a bit

thanks

That's nothing to do with the child list mod! But you would have to alter ps_product_attribute and not ps_product

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: snazzyperry on June 05, 2007, 02:08:14 am
I'm not too sure if you knew this, but there are spelling mistakes in your document and now online!

Upadte Cart should be Update Cart as this looks very unprofessional online in my store.

Where do I go to fix/edit this and correct it??
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: snazzyperry on June 05, 2007, 02:15:44 am
FOUND IT!!

It was in your 'english.php' file for the update.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on June 06, 2007, 13:25:55 pm
I have an updated ps_product_attribute.php file childlist 1.0.10 that handles child attributes as well as parent attributes

i.e. if a child has attributes or custom attributes then they will be used if not and the parent has attributes then they will be used.

This can be download from Mark Callf Design (http://design.markcallf.co.uk) direct link ChilLlist Downloads (http://design.markcallf.co.uk/index.php?option=com_docman&task=cat_view&gid=14&Itemid=27)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity mod
Post by: dj4967 on June 11, 2007, 11:10:35 am
Can I include Custom Attributes Extended 2.0 [Hack] into your tweak?

Im looking for the extras that this hack has but need your tweak.

I looked at the difference in files...huge difference.

anyway of implementing this?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: macallf on June 11, 2007, 11:57:23 am
It should be possible, but there is a difference in how my mod references the product Id. Because I am using a multiple add to cart and need to know both the child id and the parent id.

In most cases product_id becomes the parent id and prod_id becomes the product id, plus I do extra checks to in the attributes to see if it is a parent or a child and get the appropriate id for the function.

Because of this there will be a need to alter the custom attribute hack to work with prod_id and at the moment I do not have time to do this. But it is possible.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.10) + store wide quantity m
Post by: wae on June 14, 2007, 05:41:25 am
Mark, or anyone else - do you see a problem with implementing the "Save Users Cart in Database" mod with the Childlist mod?  with no tweaks, everything works fine - except for the delete cart function.  I can delete items individually no problem.  The users' cart is saving a-ok, too.

At this thread:

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=14790.30

the mod's author suggests just placing this code:
Code: [Select]
$q = "UPDATE #__{vm}_cart SET cart = '' WHERE cid = '". $_SESSION['auth']['user_id'] . "'";
$db->query ( $q );

on the function that empties the cart on the chlidlist mod. 


Call me a big dummy - but I'm not sure where that would be??  Many thanks!!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on June 16, 2007, 14:05:08 pm
The childlist mod does not empty the cart any differently than the standard VM install.

I think you may be thinking of something else. The file ps_cart is changed considereably but it should be easy to just place the relevant code in the correct places.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on June 16, 2007, 14:10:14 pm
IMPORTANT NOTICE
All further updates will only be available on  Mark Callf Designs (http://design.markcallf.co.uk/)


New version for VM 1.0.11 Available on my site
Mark Callf Designs (http://design.markcallf.co.uk/VirtueMart-1.0.x/ChildLIst.html)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: eda on June 21, 2007, 01:59:06 am
Hi, I use VirtueMart 1.0.10 with the modified files of child list and it works well.
I have 2 shopper groups (Private users and Wholesale) that see diferent prices thas means default price for wholesale and increased prices for private users.
The private users when login the shop and a add a product to shopping cart see correct price but after filling the form of billing information the price changes into the default price of the product that is assigned to wholesale users.

Can you help me??

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on June 21, 2007, 02:43:19 am
That's because the default shopper group gets assigned to newly signed up shoppers.

If your default group is wholesaler, then any new registerd user is assigned to wholesaler.

The default shopper group should be default with the higher prices assigned, when a user registers as a wholesaler then manually assign them to wholesaler and they will see the lower price.

But having said that, I've tried every combination possible and can't replicate the fault.

Unless you have set a default price for the parent and only applied the wholesaler price to the child.

You will have to post exactly how you have set up your groups and the pricing information for a parent and children that cause the problem

i.e. shopper group set to default.

price set in parent for default and wholesaler.
price set for children, default and wholesaler

Maybe then I can see for myself if there is a problem

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: eda on June 21, 2007, 10:11:30 am
Hi Mark,
Thank you for your quick response,
Here I provide you the current configuration of my shop.

(http://www.sandrovicari.it/images/vm/prod_.jpg)

(http://www.sandrovicari.it/images/vm/prod_ch.jpg)

(http://www.sandrovicari.it/images/vm/sh_g.jpg)

(http://www.sandrovicari.it/images/vm/sh_wh.jpg)

The Default shopper group is Private User with increased prices and 20% tax fee
wholesales are asigned without any fee so they are able to se the prices I've asigned to products in the product form.

If you want to have a look by yourself at my web I'll be happy to provide you admin credentials.
Thanks again
Eda
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Liz on June 27, 2007, 01:07:57 am
okay this may have come up before but i searched and cant find the answer. i installed this mod and THANK YOU it works great and is exactly what we needed.

one thing i cant figure out though. the button is now update cart and not add to cart. and then once it does the update it just refreshes the page instead of showing the cart.

is there a way to get the add to cart action back?

thanks, Liz
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on June 27, 2007, 03:05:06 am
When using a single addtocart button, the action changes to update.

Why?

If you hit addtocart again by mistake you don't get all your products added to the cart again.(My mod shows the current quantity in the cart). That's why I changed the action.

e.g. you have added 3 of child a, 2 of child b and 4 of child c. You change your mind and decide to have 2 of child c. If it wasn't changed to update cart, then you would have 6 of child a, 4 of child b and 6 of child c.

To go o the cart after adding to the cart just unselect the new option in the main configuration of VM. Show cart on add. This allows you to turn it on and off. (This is explained on my site).

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: Liz on June 27, 2007, 06:33:47 am
Thanks for the explanation!! great Mod!!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Liz on June 27, 2007, 06:42:37 am
one more question: after installing the mod my browse category page changed. now it has two lines i didnt have before and would like to remove...
"more categories" and "This category is currently empty"
see the pix below...

is this fixable?

thanks!

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: MyMusicVid on July 09, 2007, 17:05:41 pm
I'm using the latest version of this mod with Joomla 1.0.12 and VM 1.0.11, but I have a problem where the custom attribute field on a parent with no childen is not appearing on the page. I've verified that it appeared before applying the Childlist mod.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on July 09, 2007, 17:25:56 pm
I missed that one! Thanks for pointing it out.

edit ps_product_attribute.php in your-site/administrator/components/com_virtuemart/classes

starting at line 728 you will find this code

      if($prod_id) {
          $q = "SELECT product_id, attribute FROM #__{vm}_product WHERE product_id='$prod_id'";
          $db->query($q);
            $db->next_record();
        }
        if(!$db->f("attribute")) {
            $q = "SELECT product_id, attribute FROM #__{vm}_product WHERE product_id='$product_id'";
          $db->query($q);
            $db->next_record();

        }

change it to this

      if($prod_id) {
          $q = "SELECT product_id, custom_attribute FROM #__{vm}_product WHERE product_id='$prod_id'";
          $db->query($q);
            $db->next_record();
        }
        if(!$db->f("custom_attribute")) {
            $q = "SELECT product_id, custom_attribute FROM #__{vm}_product WHERE product_id='$product_id'";
          $db->query($q);
            $db->next_record();

        }

I have tested and that sorts out the problem.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: MyMusicVid on July 09, 2007, 21:25:35 pm
Thanks for the super fast response, Mark! That sorted it out.

Thanks again
Ryan
Title: Re: MOD: Child list
Post by: snazzyperry on August 08, 2007, 23:49:24 pm
I have noticed that the Child-list mod reapplies discounts TOO much. What is happening is that IF you are using the mod and you have child-listed merchandise it will reapply the discount??!!??

WHAT should be happening is that IF you have a member group that accesses their 'private' pricing, then the child-list shows different prices for the children WITH the discount added!!

What I have done is to create a wholesale group and gave them NO DISCOUNT... instead to manually type in their costs for each product (because they get a different range of discounts).
Then I have created a general price WITH a discount of say 30% for the general online traffic.

What it does is SHOW the discounted price on top BUT it reapplies the discount below - effectively giving a steeper discount to the wholesalers group!!??

It would be nice to JUST see the previous discount (30%off) and IF you are a member then you see YOUR price listed BUT without MORE discounts applied... just the item price that I manually typed in??

DOES ANYONE have suggestions or success stories using two or more member groups along with discounts applied to the retail (showing retail and the discount above)?

I FOUND out that IF you go TOO fast when entering items, then it will 'forget' and apply the discount to everything?? THEN you will have to go into each item and delete and create new - taking your time.

VM STILL will NOT eliminate nor reflect the members pricing when 'browsing' and ONLY when you are within the actual items?? I do NOT know how to get by this but this is often confusing to customers as they 'think' that the price that is shown IS their price and some don't go any further.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on August 09, 2007, 00:43:36 am
I think you will find that is not my mod that is doing something wrong, so probably the wrong thread to post in!

If you create a child product and give it a discount this will apply to all price groups. It is set per child not per price group.

i.e. If you set a discount of 10% for the child, then a discount of 10% will be applied to the default pricing, to the wholesale price and any other price group that you have set up.

It is a discount for the child, not a price group, I have verified this on a stock install (without my mod).

I am working on an advanced discount mod that should overcome all these problems, but as I said, it is not a problem with my mod!

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: snazzyperry on August 09, 2007, 00:51:19 am
I do agree that it is NOT your mod as it seems to be a problem with opening too many windows when modifying items... I was trying to save time entering the children...  :-\

I appologise for the wrongful direction to the problem at hand.

I AWAIT your mod as your child-list mod DOES work great IF you enter one item at a time slowly (not your fault again, VM maybe but I think it has to do with the calls to the database.)

Keep up the great development!

This might not be the forum topic but is there a way to eliminate the discounted prices to reflect a 'save up to 50%' instead of showing the price in the browse window?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on August 09, 2007, 01:03:44 am
This might not be the forum topic but is there a way to eliminate the discounted prices to reflect a 'save up to 50%' instead of showing the price in the browse window?

Not as such, maybe this is something that needs to be added to my advanced discount mod! Still in development, just haven't had the time to devote to it.

More details can be seen here Advanced Discount Mod (http://design.markcallf.co.uk/VirtueMart-1.0.x/Advanced-Discount-System.html)

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: happyshopper on August 15, 2007, 00:39:51 am
Is there any way on the parent page to hide the child's advanced attributes. What I need is a list of child items just as the mod puts out, with a link to the children items. Once you click on the children items, the options for that item will show up. I know that the code ask if we are on the parent page or not and outputs the tables based on this information, but it seems that there would be some way to only display the children's advanced attributes on the child's page.

The first attachment is the current output, the second would be the parent page and the third would be the child's page. I already have the child's page outputing like I want it to, but not the parent's page.

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on August 15, 2007, 00:53:34 am
The whole idea of this mod was not to go to the child product page, which adds an extra step in the buying process. (I added the link because some people wanted it, personally I can not see the point)

You could change it by testing for the parent product in ps_product_attributes.php where it checks for advanced attributes.

I am not going to, because it defeats the object of the mod.

Mark
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: happyshopper on August 15, 2007, 04:42:35 am
I understand it is not the object of this mod, but I don't see the problem with having a conditional approach to the mod. I am not a php programmer and do not know that much about it. I am just looking for a solution through what I think is a great shopping cart made even better by the mods that people like you make for the cart. From what I read on the post, the mod and the cart would not be where it is except through the suggestions of the community. My suggestion my be as needed as any other in the post before it.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: happyshopper on August 15, 2007, 22:23:53 pm
Does anyone have any ideas on what needs to be done to make this work? Any help would be greatly appreciated. I am completely lost on the PHP aspects of this.
Title: Re: MOD: Child list instead of drop down. UPDATE(1
Post by: happyshopper on August 17, 2007, 16:10:35 pm
This has been resolved. Thank you.
Title: Dropdown help plzzzzzzzzz
Post by: Patrick on August 24, 2007, 03:47:33 am
First I want to thanks Marks for this great mod! I need to make a small modification regarding  the way the attribute is display... In my child list I only have 2 attributes, which are : Format and Paper. I just need to have a drop down for Paper with 2 value (Glossy, Matte). How can I do this? In advance  Thank you!!!!!!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Gideon Newell on September 09, 2007, 03:32:36 am
Hey Mark- great mod, looks like it will perfectly suit my problem. I've installed it however, but I'm not sure if I've done so properly. My shop (VM 1.0.12 in Joomla 1.0.12 with ChildList 1.0.11) now has the 'Display Options' tab on products, but the attributes still display in the normal drop-down fashion, despite how I configure the options there. One other notable fact: after I uploaded the files and opened VM's configuration via Joomla's admin, I did not get the expected error message. Any ideas what I may have done wrong? Thanks!
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on September 09, 2007, 12:35:36 pm
This mod does not affect the attributes of a product! i.e. with my mod installed 3rd tab attributes e.g. colour,red,green,blue;size,s,m,l[+10.00]

This mod is for child products of a parent product.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Gideon Newell on September 10, 2007, 16:07:37 pm
Ah, I see- Thanks Mark. I'm definitely trying to avoid using Child Products, so I'll keep looking for an alternative way of displaying Product Attributes (without a drop-down box). I don't suppose anyone knows a good approach for that?
Title: Child List Table Header alignment
Post by: John - Australia on October 08, 2007, 11:14:35 am
Hi
I have successfully used this mod for some time, but I hsve now put it on a newsite, and the table headers are completely out of alignment with the child attributes.
Does anyone know where I can set the alignments

John
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: suleimankhan on November 05, 2007, 02:13:45 am
I just picked up on a problem with this mod and the ups shipping module where the weight is not sent to the ups module if the child item is any item other than the first item in the drop down list.

Any ideas why this might be happening Mark? I have turned debug on and can see the cart has the correct amount of weight, but can also see it is passing on a zero weight value to the UPS module.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on November 05, 2007, 03:01:21 am
Does it work with child products before my mod was installed?

The actual weight calculations in the basket.php file are no different from the original files. If the product is displayed in the cart and has the correct price, then the shipping should work too.

The shipping weights are stored in session variables. So if you had the weights set at 0 and then changed in the admin side to a new weight then the actual weight would still be 0 in VM until you had logged out and then logged in again as a user, this clears the session variables.

This could be the problem.

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: suleimankhan on November 06, 2007, 05:28:11 am
Mark, thanks for the reply. I have sent you a PM, but wanted to follow up over here. Please do not publish the url to the testing server I sent you.

To follow up with your question, no I have not got weights set at 0. I have them set at 23.2 kg for all of my products (i had them set to pounds before but then the shipping options didn't even show up)

Thanks for your prompt response.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on November 06, 2007, 10:57:11 am
As in my previous post, does it work without my mod installed?

If it does then I will look further. If it does not then it is a problem with the ups shipping option.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: toekn on November 08, 2007, 06:42:51 am
So, While I am looking for this solution, maybe it can be solved easily here.

Heres the problem
In IE

>Will not display in a table?-Ever since lightbox/morepics  mod was added.
>Selecting a product in the dropdown in IE only refreshes the page.
>Even if I deselect the override it still just refreshes the page.

In Firefox

>Will not display in a table?-Ever since lightbox/morepics  mod was added.
>Selecting a product from the dropdown list goes to the child product page EVEN when it is "overrode" in the admin.

Things I have done

>Modified the layout of the flypage
>Installed Lightbox/morepics mod(Though I am not sure the problem existed before that in IE)


If you catch it before I fix it, here is an example of my client's site : http://soulyria.com/SL/component/page,shop.product_details/flypage,shop.flypage/product_id,952/
category_id,5/manufacturer_id,0/option,com_virtuemart/Itemid,40/ (http://soulyria.com/SL/component/page,shop.product_details/flypage,shop.flypage/product_id,952/
category_id,5/manufacturer_id,0/option,com_virtuemart/Itemid,40/)

Mind the crappy pictures.
Both mods work wonderfully except for this.

I have a newborn.
I am tired.
Help.
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: macallf on November 08, 2007, 11:11:19 am
Did you install the lightbox mod for childlist!

I have 2 versions on my site because they both modify shop.product_details.php. If you are using childlist mod than you must use the lightbox for childlist mod.

Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: toekn on November 08, 2007, 13:47:29 pm
Did you install the lightbox mod for childlist!

I have 2 versions on my site because they both modify shop.product_details.php. If you are using childlist mod than you must use the lightbox for childlist mod.



I think I may cry  :D

Thanks  ;)
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Nathan on November 10, 2007, 04:53:20 am
 I updated  to ChildList 1.0.13 and I am getting this error:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at ****/*****/includes/joomla.php:4145) in /home/wright16/public_html/****/includes/joomla.php on line 800

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /*****/******/includes/joomla.php:4145) in /*****/******/includes/joomla.php on line 800

When I save a product.  I get kicked out and have to login.

Not sure if Child List is causing this as I also updated VM from 1.0.12 to 1.0.13a

Is anyone else experiencing this?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: toekn on November 10, 2007, 05:55:32 am
Yea, That sucks.

Here is how you fix it -Attached

Here is the Forum Topic

http://forum.joomla.org/index.php/topic,193707.210.html (http://forum.joomla.org/index.php/topic,193707.210.html)

 ;)

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity mod
Post by: Jeff Owens on November 29, 2007, 15:21:13 pm
OK, I may have missed this somewhere in the thread, and I think this should be fairly straightforward, but... how do I add individual child product images to the list?

I found where in ps_product_attribute to add the code, but I'm having trouble getting any code to work to display the images. I tried using variations on the "show_image" function and using $db->f('product_thumb_image') with the appropriate image path, but I've had no luck.

Anyone else tried this or can steer me in the right direction?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: hobartimus on December 10, 2007, 01:34:04 am
I have some products which do not have a price so that the visitor will see the "call for pricing" link instead of add to cart. This works as normal on the browse page, but on the product page the child list displays $0 with a quantity box.

How can I make it also use the "call for pricing" function?
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Zyke on December 14, 2007, 14:11:05 pm
Hello.
I have problem to solve and I think that Your mod can do this but... I'm not good in this stuff.
Iwant to have smth like this.(11.jpg)
(http://11.jpg)

it could be verticaly with one button add to cart

and I don't know how to do this. I dont want to have dropdown atribute  menu after each  child product.
So is there a posibility to add only one attribute menu to all of chils products

// Second thing is that taxtils have lot of colors and every model have diffrent pallete. Because there is about 1500products it is hard insert manually all the collors. So I wonder if there is posibility to add image to atribute like class so i could write {red} in description and vm will show image with the collor
this are collors for one shirt (22.jpg
(http://22.jpg)
// I've solved this with extended attribute mod

Hope smb can help.
Zyke

[attachment cleanup by admin]
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: maschi2007 on April 24, 2008, 18:06:08 pm
hello,

hat jemand eine idee wie man das so hinbekommt ???
wie bei den posting von zyke bild 11.jpg
dropdown für farbe und die größen mit eingabe (abbildung der farbe ist nicht so wichtig)

gruß

mario

someone got an idea in such a way as one
as is the case for posting of Zyke pic. 11.jpg
drop down for color and the sizes with input


Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: maschi2007 on April 28, 2008, 10:16:34 am
please help  ???
Title: Re: MOD: Child list instead of drop down. UPDATE(1.0.11) + store wide quantity m
Post by: Michele Rocco on May 13, 2008, 01:15:10 am
Hello Mark,
thankyou for your wonderfull hacks to VM, they're realy great!

I'm tryng the Child list on VM 1.0.15 and seems to work right, except for one thing ... on the child products the price are always the defoult prices, it don't take care of the other group prices that I set.

for example I se 1 main product with the price to 0,00 because I need it only as a main product to be displayed (the user must not be able to buy it) and after add some childs products with thei own sku numember and prices, like product 1 = 10$ prod 2 = 20$ and so on ... now on child product I add a price for reseller like prod 1 = 5$ but when a reseller log on the system he see the price without vat (as I set on VM) but for the defoult price (10$) ... what I'm doing wrong???

Best regards and thankyou again,
Michele
Title: Has anyone combined Childlist & Qty Mod with Shopper Group Extension mod?
Post by: slees32 on July 05, 2008, 07:42:48 am
EDIT - after fully uninstalling Childlist, then installing Shopper Group, I have found that I still have the functionality I require to select multiple products, without having to go to the cart each time I click the add to cart button.
I thought that I only got that from the Childlist mod.
Maybe I never needed it? - that's amateurs for you.
Anyway, I can't say just how relieved I now am to be finally finished.
**********************

I love both these mods and can get each working independently.
But after several days it looks like it is beyond me to combine them.
From Childlist I use the ability to add multiple products before going to the cart.
From Shopper Group I am able to lock down certain products to certain customers.
And I cannot finish this shopping cart for a friend without both functionalities.
I have posted more details about this in the Shopper Group Extension topic here http://forum.virtuemart.net/index.php?topic=35677.msg135274#msg135274 (http://forum.virtuemart.net/index.php?topic=35677.msg135274#msg135274)

Is there anyone who may have already done this that could help me?

Regards - Steve