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

johnnybravo

  • Jr. Member
  • **
  • Posts: 66
excellent thanks teemu_m

John

thomas_freeman

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 450
    • Kustom Services
Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
« Reply #316 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 " for quotes.  Is there an easy way or a good reason not to change this?  Thanks!

macallf

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

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.7) + store wide quantity m
« Reply #318 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 (" etc.)

I've attached an image.

[attachment cleanup by admin]

VMuser

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

macallf

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

punz

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

Justin Z

  • Beginner
  • *
  • Posts: 37
Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
« Reply #323 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]

macallf

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

Justin Z

  • Beginner
  • *
  • Posts: 37
Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
« Reply #325 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]

macallf

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

Justin Z

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

macallf

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

Justin Z

  • Beginner
  • *
  • Posts: 37
Re: MOD: Child list instead of drop down. UPDATE (1.0.7) + store wide quantity m
« Reply #329 on: December 14, 2006, 22:36:50 pm »

That was it, thanks Mark!