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

macallf

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

maddunr

  • Jr. Member
  • **
  • Posts: 165
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
« Reply #166 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

macallf

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

maddunr

  • Jr. Member
  • **
  • Posts: 165
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
« Reply #168 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]

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (
« Reply #169 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
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!

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
« Reply #170 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.

macallf

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

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
Mark
All of My old mods are now available on my website.
Mark Callf Designs

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

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

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
« Reply #172 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!

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity m
« Reply #173 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
Seek and ye shall find.........
4 VM sites and counting

gizmoidea

  • Beginner
  • *
  • Posts: 3
Re: MOD: Child list instead of drop down. UPDATE (1.0.6) + store wide quantity mod
« Reply #174 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

macallf

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

gizmoidea

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

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
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]
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.

gizmoidea

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

kaputtendorf_fred

  • Beginner
  • *
  • Posts: 4
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