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

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #90 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]
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

Andrew

  • Jr. Member
  • **
  • Posts: 59
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #91 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

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #92 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
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #93 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
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #94 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
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #95 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:



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]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #96 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
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #97 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 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.



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]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

rub3licious

  • Beginner
  • *
  • Posts: 18
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #98 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



"Not everything that can be counted counts, and not everything that counts can be counted."
    - Albert Einstein (1879-1955)

rub3licious

  • Beginner
  • *
  • Posts: 18
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #99 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
"Not everything that can be counted counts, and not everything that counts can be counted."
    - Albert Einstein (1879-1955)

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #100 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

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

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

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

rub3licious

  • Beginner
  • *
  • Posts: 18
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #101 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
"Not everything that can be counted counts, and not everything that counts can be counted."
    - Albert Einstein (1879-1955)

rub3licious

  • Beginner
  • *
  • Posts: 18
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #102 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
"Not everything that can be counted counts, and not everything that counts can be counted."
    - Albert Einstein (1879-1955)

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #103 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
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

rub3licious

  • Beginner
  • *
  • Posts: 18
Re: MOD: Child list instead of drop down. UPDATE (1.0.6)
« Reply #104 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

"Not everything that can be counted counts, and not everything that counts can be counted."
    - Albert Einstein (1879-1955)