Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length


Need Professional Support? Head over to the VirtueMart Experts of vm-expert.com and see what they can do for you.

  Advanced search

216589 Posts in 58326 Topics- by 87990 Members - Latest Member: barry2mayer432
Pages: [1]   Go Down
Print
Author Topic: Hacking the Flypage or detail page  (Read 6842 times)
John M
Full Member
***
Posts: 198



View Profile WWW
« on: December 11, 2005, 22:28:20 pm »

Hi all I need to add some attributes to the fly page to pull from the database directly.  I have a gem site and my customer wants to display under the product_name the attributes of the particular item displayed.  FOr instance we have several gem sizes for each gem however the first gem on the select drop down is the price shown in the display. 

I want to let the customer know that this is the item they are looking at and the size is {product_width} and the weight is {product_weight} then I can for that one item include in the products makeup the weight of the stone and the length could be a numerical number of say 3 and I can simply type carat after the attribute or variable {product_weight}

So what I was trying to create was this 

Ruby Emerald

Shape: Ruby Emerald I used the {product_name} here
Size & Weight: {product_weight} this is not showing up
Clarity {category_id} My clarity is defined in the browse page as the sub category of ruby
Price: $339.41 (including 7.75 % tax) ( Manufacturer )

Thank you for any help with this.

JM
Logged

"Life is not a journey to the grave with the intention of arriving safely in a well preserved body, rather to skid in broadside, thoroughly worn out, and loudly proclaiming, Damn that was fun, what a ride!"
kawika
Newbie
*
Posts: 23


View Profile WWW
« Reply #1 on: December 11, 2005, 23:37:14 pm »

The flypage tags are replaced in the file administrator/components/com_virtuemart/html/shop.product_details.php.

You need to add the code to fill a variable then do a str_replace() to replace the flypage tag.
Logged

Thanks,
Kawika Ohumukini
www.SourceOmnimedia.com - PHP and Open Source Education
John M
Full Member
***
Posts: 198



View Profile WWW
« Reply #2 on: December 11, 2005, 23:59:34 pm »

can you giv e me an example, my coding abilities are a bit limited.  I can do it if I have an example.

Thank you for your reply
JM
Logged

"Life is not a journey to the grave with the intention of arriving safely in a well preserved body, rather to skid in broadside, thoroughly worn out, and loudly proclaiming, Damn that was fun, what a ride!"
kawika
Newbie
*
Posts: 23


View Profile WWW
« Reply #3 on: December 12, 2005, 01:48:25 am »

Are you putting the {product_weight} text into the product description? If so, that won't work.

I just tested adding the {product_weight} right into the flypage and it worked.

Let me know.
Logged

Thanks,
Kawika Ohumukini
www.SourceOmnimedia.com - PHP and Open Source Education
John M
Full Member
***
Posts: 198



View Profile WWW
« Reply #4 on: December 12, 2005, 16:11:26 pm »

No the only problem with that is that the product weight is not the actual shipping weight rather the weight of the diamonds on carat weight.  Would I need to add an extra feild into my DB? for carat weight?

I am hoping I can extract the first line of the select attributes, that is the information I really need.

I hope that is making more sence now.

JM
Logged

"Life is not a journey to the grave with the intention of arriving safely in a well preserved body, rather to skid in broadside, thoroughly worn out, and loudly proclaiming, Damn that was fun, what a ride!"
kawika
Newbie
*
Posts: 23


View Profile WWW
« Reply #5 on: December 12, 2005, 20:10:52 pm »

Hello,

One way to do that is to add a product type "Gem Details" and a parameter for it "Carat Weight".

The list will appear as a table on the product details page, replacing the {product_type} tag.

Here's a quick tutorial.

CREATE PRODUCT TYPE
1. Click Products -> Product Type -> Add/Edit Product Type.
2. Product Type Name: Gem Details.
3. Click Save.

ADD PARAMETER
1. On Product Type List, In Parameters column, Click [ Show ].
2. Click New.
3. Enter details.
(i)   Parameter Name: carat_weight
(ii)   Parameter Label: Carat Weight
(iii)   Parameter Type: Short Text
4. Repeat for each characteristic.

ADD PRODUCT TYPE TO PRODUCTS
1. Go to product list.
2. Edit product.
3. Click Add Product Type button (top-right).
4. Select Gem Details.
5. Click Save button.
6. Repeat for each product.

UPDATE GEM DETAILS IN PRODUCT
1. Go to product list.
2. Edit product.
3. Click Gem Details tab.
4. Enter the text to display on the product details page.
5. Repeat for each parameter setting.
6. Repeat for each product.

POSITION PRODUCT TYPE TABLE
1. Edit flypage.php.
2. Move {product_type} under {product_name} tag.

One downside is that the whole table will appear for products assigned a product type.  So if you have a lot of characteristics, you might want to enter it all into one field. Otherwise the product type table gets kind of tall.

I hope that helps.
« Last Edit: December 12, 2005, 20:13:21 pm by kawika » Logged

Thanks,
Kawika Ohumukini
www.SourceOmnimedia.com - PHP and Open Source Education
Michel Beek
Newbie
*
Posts: 32


View Profile
« Reply #6 on: November 22, 2006, 20:03:39 pm »

Hello,

It's an old question in this thopic and don't want to start a new one, but i'm stressing out, maybe someone can help me. I'm trying to get the product_available_date in the flypage but after several hours of trying to do so i just can't get it done.

I insert the line $template = str_replace( "{product_available_date}", $product_available_date, $template ); in the shop.product_details.php for using the variable in the flypage and mayby use it too in the browse_1, but nothing is showing.

Maybe it's simple, but help me out.

Greetings

Michel
« Last Edit: November 22, 2006, 20:11:08 pm by Michel Beek » Logged
Michel Beek
Newbie
*
Posts: 32


View Profile
« Reply #7 on: March 30, 2007, 14:42:25 pm »

Finaly i found it myself (after a few months) how to add the product_avaiilable_date to the flypage.

So for the one who's eating there brains out like i did, here's the solution.

Edit administrator/components/com_virtuemart/html/shop.product_details.php

find the code near the end of the file:

Code:
/** NOW LET'S BEGIN AND FILL THE TEMPLATE **/
$template = str_replace( "{navigation_pathway}", $navigation_pathway, $template );
$template = str_replace( "{navigation_childlist}", $navigation_childlist, $template );
$template = str_replace( "{product_name}", $product_name, $template );
$template = str_replace( "{product_image}", $product_image, $template );
$template = str_replace( "{full_image}", $full_image, $template ); // to display the full image on flypage
$template = str_replace( "{more_images}", $more_images, $template );
$template = str_replace( "{file_list}", $file_list, $template );
$template = str_replace( "{edit_link}", $edit_link, $template );
$template = str_replace( "{manufacturer_link}", $manufacturer_link, $template );
$template = str_replace( "{product_price}", $product_price, $template );
$template = str_replace( "{product_s_desc}", $db_product->f("product_s_desc"), $template );
$template = str_replace( "{product_description}", $product_description, $template );
$template = str_replace( "{product_weight}", $db_product->f("product_weight"), $template );
$template = str_replace( "{product_sku}", $db_product->f("product_sku"), $template );
$template = str_replace( "{addtocart}", $addtocart, $template );
$template = str_replace( "{product_reviews}", $product_reviews, $template );
$template = str_replace( "{product_reviewform}", $product_reviewform, $template );
$template = str_replace( "{product_availability}", $product_availability, $template );
$template = str_replace( "{vendor_link}", $vendor_link, $template );
$template = str_replace( "{mosConfig_live_site}", $mosConfig_live_site, $template );
$template = str_replace( "{related_products}", $related_product_html, $template );
$template = str_replace( "{product_type}", $product_type, $template ); // Changed Product Type
$template = str_replace( "{product_packaging}", $product_packaging, $template ); // Changed Packaging

add after the last line this code:
Code:
$template = str_replace( "{product_date}", date('d-m-Y', $db_product->f("product_available_date")), $template );

save the file and use the {product_date} tag in your flypage

Greetings Michel
Logged
nobbyryan
Newbie
*
Posts: 32


View Profile
« Reply #8 on: January 15, 2008, 17:22:48 pm »

Excellent work. Is there any way to also get the date into the product scroller?
Logged
Pages: [1]   Go Up
Print
Jump to: