marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
Use Product Type Sort Order to Format Pages

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Use Product Type Sort Order to Format Pages »
Welcome, Guest. Please Login or Register.
01/21/18 at 14:52:43
Home Help Search Login Register
   marty.net message board
   About cpshop
   Feature Requests
   Use Product Type Sort Order to Format Pages
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Use Product Type Sort Order to Format Pages  (Read 1493 times)
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Use Product Type Sort Order to Format Pages
« on: 11/03/06 at 23:31:50 »
Reply with quote Modify message

Hey Marty,

It may not be too difficult to provide simple formatting for product thumbnail pages via the thumbnail sort order file added in the latest release (brilliantly executed, btw). I'm thinking a line like

class_name: Your Header Text Here

appearing in the file could be printed as

<div class="class_name">Your Header Text Here</a>


Something like


Code:
section_header:Cheap Stuff
thumb_header:Stickers
50
51
90

thumb_header:Buttons
121
120
118
143
142
141

thumb_header:Magnets
123
122
119
139
138
137

thumb_header:ornaments
105
124


A slightly more complex implementation might look like

FILE:/templates/ornament_header.php

Something like this would be REALLY, REALLY COOL.

cheers,

p.
« Last Edit: 11/04/06 at 00:32:01 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Use Product Type Sort Order to Format Pages
« Reply #1 on: 05/18/07 at 02:22:57 »
Reply with quote Modify message

I've implemented something like this in the next version, though it's much, much simpler.

Anything you enter in the sortorder file that is not:

- a comment
- a blank line
- a product type number
- a list of product type numbers
- the word END by itself

will be printed on its own line, as is.  If the thumbnail grid table isn't disabled, it'll be formatted into the table accordingly.

Think something like this:

<div class="deptheader">Green shirts</div>
108
<div class="deptheader">Yellow Shirts</div>
107
<div class="deptheader">Women's T-Shirts</div>
89
<div class="deptheader">Value T-Shirts</div>
112
<div class="deptheader">Everything Else</div>

I think that should be functional enough to accomplish anything you'd want to do.

(And yes, hooks and pagination are supported.)
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Use Product Type Sort Order to Format Pages
« Reply #2 on: 05/18/07 at 05:38:44 »
Reply with quote Modify message

BRILLIANT!

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Use Product Type Sort Order to Format Pages
« Reply #3 on: 05/18/07 at 13:03:50 »
Reply with quote Modify message

Trying out the product sort order templating feature.  VERY COOL!

It did create an issue with my sortorder files though. The Beta2 version changes the way comments are handled. Originally something like the following worked fine:

Code:
    # most popular shirts
112  # value t
7  # light tee
2  # white tee
23  # hooded Sweatshirt
109  # women's light tee
134  # cap sleeve
165  # women's long sleeve
102  # jr. Raglan
6   # Jr. Babydoll


It's not the way you documented it (# Note: blank lines, and lines that begin with # are ignored), but it's a nice, if inadvertent, feature for documenting sortorder files.

The Beta2 release of cpshop breaks on indented and inline comments.  I'm changing the files over but the documentation isn't as pretty

cheers,

p.

« Last Edit: 05/18/07 at 13:06:22 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Use Product Type Sort Order to Format Pages
« Reply #4 on: 05/18/07 at 13:05:40 »
Reply with quote Modify message

I can probably update it to check for comments.  It's just tricky when people put things like colors in HTML:

<font color="#FFFFFF">blah</font>

I don't want to strip out everything after the # in that case.

And my original expectation with the comments was that people would do something more like:


Code:
##### most popular shirts
# value t
112  
# light tee
7  
# white tee
2  
# hooded Sweatshirt
23  
# women's light tee
109  
# cap sleeve
134  
# women's long sleeve
165  
# jr. Raglan
102  
# Jr. Babydoll
6  


But your point is well-taken.  I'll get'em all to work.
« Last Edit: 05/18/07 at 13:08:02 by Marty » Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Use Product Type Sort Order to Format Pages
« Reply #5 on: 05/18/07 at 13:17:11 »
Reply with quote Modify message

While I'm writing, a couple of additional feature enhancement requests for sortorder files.

1. <[pagebreak]> would complete the current page, create a new one and continue sorting subsequent products into the new page.

Use the current thumbnail page naming convention.  Shopkeepers would then add their own pagination code after each <[pagebreak]> tag, using cpshop tags to define the URLs for each page.

2. Allow multiple entries for product types.

This would let shopkeepers place products in more than one category.  EG: a


Code:
<h2>Top Sellers</h2>
#dark tees
152
155
#license plate frames
52

<h2>Buttons</h2>
#buttons
# round
118
# minis
141

#t-shirts
<h2>Dark Tees</h2>
# starting with dark Tees
152
155
161
164


This would make cpshop a pretty capable mimic of CafeWish but with much more power. (And the lag time of cpshop page loads limited to the occasional cache refresh rather than the 1-2 second delay CW requires on every page.)

win-win-win...


p.
« Last Edit: 05/18/07 at 13:40:32 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Use Product Type Sort Order to Format Pages
« Reply #6 on: 05/18/07 at 13:40:49 »
Reply with quote Modify message



on 05/18/07 at 13:05:40, Marty wrote:
It's just tricky when people put things like colors in HTML:

<font color="#FFFFFF">blah</font>


Ahh, but of course.  Hadn't thought that far ahead!

Quote:

Code:
##### most popular shirts
# value t
112  
# light tee
7  
# white tee
2  
# hooded Sweatshirt
23  
# women's light tee
109  
# cap sleeve
134  
# women's long sleeve
165  
# jr. Raglan
102  
# Jr. Babydoll
6  


That's what I do now.



Anyone who wants to see a quick-and-dirty installation (about 15 mins) see http://www.peaceandloveshop.com/peace_signs/criticalgraphic/1168123
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright © 2000-2001, X-Null. All Rights Reserved.