VirtueMart 2 + 3 > Product creation

Attributes/Custom Fields Thread

<< < (35/77) > >>

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....

--- End quote ---

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....

--- End quote ---

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

mowgs:

--- 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>


--- Code: ---<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>
--- End code ---

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.... :)

--- End 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.

**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.

--- End quote ---

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

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?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version