Jump to content


Photo

One Avactis Tag With Two Different Output


  • Please log in to reply
13 replies to this topic

#1 vasu18

vasu18

    Devotee

  • Members
  • PipPipPipPip
  • 140 posts
  • Gender:Male
  • Location:U.S.A

Posted 02 July 2009 - 01:40 AM

I want to use Avactis Tag ProductList() to produce two different output on two different pages. On one page, that is index.php, where the Tag ProductList(1) is located, i want to display the default template with product picture and product name with two columns set in product list configuration file. On all other pages or all other categories ( ex-ProductList(34) ), I want two display some new look of ProductList(), that is only product name in only one column set in product list configuration file. How to create two product-list-config.php ---- How to create two product-list.tpl --- and how to create product-list-container.tpl ?? I have already designed what I want but dont know how to create two set of product list templates so that i can dispaly two different ouput using ProductList() on different pages. Does any one know how to do this? To create unique design for home category, I have created a file product-list-front.tpl.html and my product-list-config is ; This is a comment ; ; ProductList configuration ; Template-Container = product-list-container.tpl.html Template-Container-Empty = product-list-container-empty.tpl.html Template-ProductType{default} = product-list-item.tpl.html Template-ProductType{1} = product-list-front.tpl.html Template-OutOfStock-ProductType{default} = product-list-item-out-of-stock.tpl.html Option-Columns=2 But the home page is showing the default template. Any Help ??

#2 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 02 July 2009 - 08:49 AM

Use a new advanced Avactis feature: Custom Product Sets.

  • Upload the attached file to your server: Attached File  product_set.php   5.65KB   272 downloads
  • Include it at top of page, right after init.php, the same way;
  • Insert the <?php Products(); ?> tag where necessary. You can also supply category ID and template directory: <?php Products( 42, 'sale' ); ?>
  • The tag reads templates from avactis-templates\catalog\product-set\default\. If you specified sale above, the blue dir name will be sale. Default templates: Attached File  product_set_templates.zip   2.41KB   187 downloads
  • (Optionally) Edit the PHP file to tweak the list output. You can change a lot of settings, like randomizing the order or displaying offline products, etc...

This way you can create several product lists that can look totally different, because they will use templates from different directories.

Edited by David Frost, 06 July 2009 - 05:23 AM.
Added default templates


#3 vasu18

vasu18

    Devotee

  • Members
  • PipPipPipPip
  • 140 posts
  • Gender:Male
  • Location:U.S.A

Posted 03 July 2009 - 12:11 PM

Thanks David This is something new for me and may be for many members. Here what I did. 1. I downloaded the file product_set.php and included it under init.php in index.php ( saved it on my server with init.php ) 2. I created new directory named "front" in avactis-template/catalog/product-set/front with the customized set of template. 3. then I insert the new tag <?php Products( 1, 'front' ); ?> in place of <?php ProductList( 1 ); ?> in index.php to display some unique design for only home category. But my index.php is blank except header and side navigation. All other categories are displaying their respective products with default Avactis template. Is there anything wrong I am doing? I have created a 'front' directory and kept all the files as it is in the 'Default' directory of avactis-template/catelog/product-list/default to see whether things work or not. I have also change config file statement like Template-ProductType{Default} = product-list-item.tpl.html Template-OutOfStock-ProductType{Default} = product-list-item-out-of-stock.tpl.html into Template-ProductType{front} = product-list-item.tpl.html Template-OutOfStock-ProductType{front} = product-list-item-out-of-stock.tpl.html But still it's not working.

Edited by David Frost, 05 July 2009 - 07:34 AM.
Please don't quote full previous message


#4 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 05 July 2009 - 07:51 AM

Template-ProductType{front} = product-list-item.tpl.html

This is not gonna work. This is a completely different story. Go to Avactis admin / Catalog / Manage Product Types. These are types of your products. Click on any type. You will see many parameters. The very first, red one, Product Type ID, is the number that you should put in those curly braces in config file. Like this:

Template-ProductType{ 3 } = book.tpl.html

(if your Books type has ID=3)

This is completely unrelated to Custom Product Sets. Product set uses its own templates.

Maybe the problem is in the templates from the front directory. You should have copied the default directory to front directory and carefully edit the templates, leaving PHP code intact. Did you do it this way or some other one?

#5 vasu18

vasu18

    Devotee

  • Members
  • PipPipPipPip
  • 140 posts
  • Gender:Male
  • Location:U.S.A

Posted 06 July 2009 - 02:15 AM

David,

I am trying to use Custom Product Set only. I have used two tags in my index.php

<?php include('product_set.php'); ?> and <?php Products(1,'front'); ?> where 1 is the Home Category ID and 'front' is the directory I have created in avactis-templates\catalog\product-set\front with following template files

1. Images
2. product-list-config
3. product-list-container.tpl
4. product-list-container-empty.tpl
5. product-list-item.tpl
6. product-list-item-out-of-stock.tpl


where the content of product-list-config is

; This is a comment
;
; ProductList configuration
;

Template-Container = product-list-container.tpl.html
Template-Container-Empty = product-list-container-empty.tpl.html

Template-ProductType{1} = product-list-item.tpl.html
Template-OutOfStock-ProductType{1} = product-list-item-out-of-stock.tpl.html

Option-Columns=2

The above five files in 'front' directory are exactly same as the files in avactis-templates\catalog\product-list\default. The only difference is the content of product-list-config file.

; This is a comment
;
; ProductList configuration
;

Template-Container = product-list-container.tpl.html
Template-Container-Empty = product-list-container-empty.tpl.html

Template-ProductType{default} = product-list-item.tpl.html
Template-OutOfStock-ProductType{default} = product-list-item-out-of-stock.tpl.html

Option-Columns=2

My intention is to separate the template of product list appears on index.php from all other product list on other pages of my website.

After doing all this my index.php page is blank without any product. I am doing something WRONG.

#6 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 06 July 2009 - 05:19 AM

The directory that you supply in the tag should contain the following 4 templates:

product-set-container.tpl.html
product-set-container-empty.tpl.html
product-set-item.tpl.html
product-set-item-out-of-stock.tpl.html


I zipped the default ones: Attached File  product_set_templates.zip   2.41KB   161 downloads

The templates are different from those of a regular product list.

#7 vasu18

vasu18

    Devotee

  • Members
  • PipPipPipPip
  • 140 posts
  • Gender:Male
  • Location:U.S.A

Posted 08 July 2009 - 03:06 PM

YES! That's what i was doing wrong. I changed the file names and it started working. Thanks David.

#8 joris

joris

    Novice

  • Members
  • PipPip
  • 24 posts
  • 1.9.1

Posted 03 November 2009 - 07:06 AM

after reading this topic letter by letter for about 50 times i finally had succes! and made a custom custom Sale page
sale.JPG


<li>(Optionally) Edit the PHP file to tweak the list output. You can change a lot of settings, like randomizing the order or displaying offline products, etc...



i still left with a few questions:
David, in point 5 you mention that its possible to randomize the the order of products. i dont see how in the product_set.php





----------------------------------------------------------------------

update
---------------------------------------------------------------------

thank you!

vasu and david, thank you for this workaround to show a custom product list.

like i said before i managed to create also a custom page. now i need to create 2 or more custom pages and things dont work anymore.

i want to create a custom sale page productlist (done, working)
and create a second custom page "monday"

i copied and renamed product_set.php to product_set_monday.php. updated and adjusted the file with the new template directory called also "monday"

in a file monday.php i added <?php include('init.php'); ?> <?php include('product_set_monday.php'); ?>

and its working! it shows the second custom productlist......but than you click on the thumbnail, it does'nt bring you to the product info of that product.....but to the store root folder ***/store

i cant see how it must be something hardcoded in the avactis system. or do i mis something here?



joris

#9 Guest_Marco_*

Guest_Marco_*
  • Guests

Posted 03 November 2009 - 09:34 AM

Wow, what a redirect! Certainly something is wrong with setup. What's in your .htaccess file?

#10 vasu18

vasu18

    Devotee

  • Members
  • PipPipPipPip
  • 140 posts
  • Gender:Male
  • Location:U.S.A

Posted 03 November 2009 - 02:07 PM

Yes, I saw that. When you click on that blue T-shirt it should direct to http://www.universeonatshirt.com/store/product-info.php?pid141.html, but it's going to here http://www.universeonatshirt.com/store/.

Did you clear system cache? if not thats the first step you should do.

#11 joris

joris

    Novice

  • Members
  • PipPip
  • 24 posts
  • 1.9.1

Posted 03 November 2009 - 02:44 PM

okee i nailed it down to what the problem was. the monday category was not online. avactis apparently can't show offline categories but it can show offline products. now i just make a category called "." and make all products offline. that way you cant acces them from the main menu, but i can acces them from the custom page workaround. its an ugly workaround but it works. if only the product_set.php would have an option to show ofline categories..... something like : $set->filter->select_online_categories_only = false; # bool: true or false but that doesnt work does anybody know if its possible to show offline categories? ---------------------------------------- update ---------------------------------------- aaahhhhhgggg i'm going crazy... i got it all working now with the workaround. but now the items are not going into the shopping cart. it turns out that offline products can be shown but you cant add them to the cart..... so hit a dead end, its not possible

#12 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 04 November 2009 - 11:34 AM

Unfortunately, there is no way to display an offline category :(

#13 joris

joris

    Novice

  • Members
  • PipPip
  • 24 posts
  • 1.9.1

Posted 04 November 2009 - 04:21 PM

Unfortunately, there is no way to display an offline category :(


hmm too bad. so what about the random products in the product set.php you mentioned?

#14 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 05 November 2009 - 06:08 AM

Sorry, I was wrong, there is no setting for randomizing product set output in this class. I'm not the person who implemented this, and there is no official documentation yet.

You can randomize products by making changes in function getProductListByFilter in avactis-system/modules/catalog/catalog_api.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users