News:

Support the VirtueMart project and become a member

Main Menu

Attributes/Custom Fields Thread

Started by PRO, September 12, 2011, 15:02:49 PM

Previous topic - Next topic

karbono

#165
I'm importing data directly from MSSQL and I'll be generating a different SKU than the parent. Something like child_sku='parent_sku'+'sizeid'+'colorid'. This should work while noone creates a different attribute like "material" on the ERP side, which would mess up this whole system...

karbono

#166

If "Do not Display Product" is set in "Actions when product is out of stock", I still see the product in the dropdown list and get a 404 page when I select it.

Unfortunately, something similar also happens with joomla's search. the products still appear in the results regardless of whether or not they are visible.

karbono

#167
Another interesting issue/feature (?):

If the parent product has stock = 5, and a child product has stock = 0, it will ignore the childs lack of stock and allow 5 units to be ordered. I can't forget to keep the parent's stock=0 (no reason it should be 0, anyway).

chiappa

Did you find out how to sort your Generic Child Variants in the product views drop down?

The product order settings has no effect and weirdly enough looks like it's not sorting by ID either.. Saving new child variants in the correct order worked so far but it's not really a good system is it....

karbono

Quote from: chiappa on March 22, 2012, 11:16:37 AM
Did you find out how to sort your Generic Child Variants in the product views drop down?

The product order settings has no effect and weirdly enough looks like it's not sorting by ID either.. Saving new child variants in the correct order worked so far but it's not really a good system is it....

I didn't get that far and didn't even notice that issue. Yesterday I went back to Drupal/Ubercart, but Drupal's bulk import has it's own set of issues (variants with specific sku, inability to import stock via feeds, etc, etc). CSVI is a God-send... I just need those variables with stock.

karbono

Quote from: chiappa on March 22, 2012, 11:16:37 AM
Did you find out how to sort your Generic Child Variants in the product views drop down?

The product order settings has no effect and weirdly enough looks like it's not sorting by ID either.. Saving new child variants in the correct order worked so far but it's not really a good system is it....

Would this help?
http://forum.virtuemart.net/index.php?topic=90362.30

corymp

Quote from: chiappa on March 22, 2012, 11:16:37 AM
Did you find out how to sort your Generic Child Variants in the product views drop down?

The product order settings has no effect and weirdly enough looks like it's not sorting by ID either.. Saving new child variants in the correct order worked so far but it's not really a good system is it....

if you go into your product parent in backend and scroll down on the main tab, you will see all your child variants. you can sort them there
VM 2.0.4 Stable
J2.5.4

mowgs

#172
Quote from: corymp on March 19, 2012, 01:02:49 AM
I have made some more progress.

I have successfully set up the children to display the Parent's Title. It involves creating a custom field type string, Custom field type parent,

1. Change the code in /templates/yourtemplate/html/com_virtuemart/productdetails/default.php to this below:

You are looking for <h1  id="product_name"><?php echo $this->product->product_name ?></h1>

<h1  id="product_name">
<?php
if (!empty(
$this->product->customfieldsSorted['Product'])) { 
       
$custom_title null;
       foreach (
$this->product->customfieldsSorted['Product'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

else {
echo $this->product->product_name;
}
}


else {
echo $this->product->product_name;
}?>

</h1>


2. Once that is done, check your product details page in your browser to make sure the page loads correctly. Choose a page with no custom fields.

3. Once that is done, create a custom field type Parent with these settings:

Type=Parent
Title="Parent"
Published="yes"
Cart Attribute="No"
Layout Position="ontop"

4. Next step, Create a custom field type String with these settings:

Type="String"
Title="anything you want" (it wont be displayed)
Published="yes"
Parent="Parent"
Cart Attribute="No"
Layout Position="Product" Case sensitive if you copied my script

5. Now.. whatever attributes you made to show in the add to cart area (ie. the dropdown), you must set the custom fields to have the same parent as the custom string we just created.

6. Once that is done, go to your parent product, remove all custom fields and add the custom field parent we just created.

7. Type in the name of the parent product and save. All children of this product will get the custom string to show up as the product title.

This script/setup will inject That product name as the title of all children product pages and if there are no custom fields for this product, the original product title will show.

I hope this was easy to understand. if you follow precicely, it will work as you can see here -> http://test2.firenl.com/store/eliquid/tobacco-flavors/flue-cured-tobacco-detail

Any questions you can contact me, but just to let you know, I am very busy and it may be a while for me to get back to you during a work week. My day job actually is designing fire protection sprinkler systems. web design is just a weekend hobby for me.... :)

Hi, thanks for your work so far!  Just gone through to find the file you talked about, and I don't have 1!  I'm just using beez5 at the moment, and have Virtuemart set to use -default- as its template.

**EDIT - found it!  found it in /httpdocs/components/com_virtuemart/views/productdetails/tmpl/default.php

corymp

Quote
Hi, thanks for your work so far!  Just gone through to find the file you talked about, and I don't have 1!  I'm just using beez5 at the moment, and have Virtuemart set to use -default- as its template.

components/com_virtuemart/views/productdetails/tmpl/default.php     copy to   templates/yourtemplate/html/com_virtuemart/productdetails/default.php

components/com_virtuemart/views/category/tmpl/default.php     copy to   templates/yourtemplate/html/com_virtuemart/category/default.php

components/com_virtuemart/views/cart/tmpl/default_pricelist.php     copy to   templates/yourtemplate/html/com_virtuemart/cart/default_pricelist.php


This will override the default views for those pages
VM 2.0.4 Stable
J2.5.4

mowgs

Thank you - think I found them not long before you posted.

Its getting there, the one thing now, is I had 3 custom fields, one for colour, one for bra size and one for Brief size.

I've done the edits as detailed in this post for the Colour field, and this works brilliantly!

But, Now in the cart, I cant see the detail for the Bra Size or Brief Size that has been chosen?

Does the prow->customfields that has been commented out show this?


corymp

The short description will be the product name at this point you have to inject the product short description where the product name would be. Please keep in mind, you will have to do the same thing with order emails, and the orders page as well, I haven't gotten that far yet...
VM 2.0.4 Stable
J2.5.4

b.adams91

Hi,

I have figured out how to add custom attributes to my products using sizes, however when I include the sizes it always shows "no additional charge" beside the size.
Could someone please help me out.

Thanks,
Brandon

John2400

 b.adams91,
Hi ,

You can delete and change the message 'No additional charge.. "
There is a file in the public or home section of your server that is the 'language' folder.
Open that file >> find the language you use and then open the file 'de-DE.com_virtuemart.ini' file and you will be able to edit that file and delete any wording you wish.. Might just be best to just delet the words and mot the whole line in the file leave it as "" .

karbono

I just read the "Virtuemart News" e-mail. I got slightly excited when reading
QuoteThe use of child variants got strongly enhanced.
, but thinking about it, I'm sure they don't mean stockable variants functionality...

I'm giving it a shot with the VM2.0.4-RC version...

dsrpmedia

#179
QuoteI have figured out how to add custom attributes to my products using sizes, however when I include the sizes it always shows "no additional charge" beside the size.
Could someone please help me out.

Do you mean you figured out how to include the size attribute info in the child product dropdown?

eg

hand shovel - small
hand shovel - medium
hand shovel - large

etc?

IF so could you please tell me how?

when I add child products using a sizr attribute I am just getting

hand shovel
hand shovel
hand shovel

in the dropdowns