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

YOU ARE HERE:
Product Type Numbers String = "Product Typ" output

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Product Type Numbers String = "Product Typ" output »
Welcome, Guest. Please Login or Register.
12/13/17 at 17:05:58
Home Help Search Login Register
   marty.net message board
   About cpshop
   Feature Requests
   Product Type Numbers String = "Product Typ" output
(Moderator: Marty)
Pages: « 1 2 3 4 5 6 » Reply Notify of replies Send the topic Print 
   Author  Topic: Product Type Numbers String = "Product Typ" output  (Read 9310 times)
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Product Type Numbers String = "Product Typ" ou
« Reply #60 on: 12/12/11 at 23:06:35 »
Reply with quote Modify message



on 12/11/11 at 19:22:05, brattytees wrote:
Finally got the breadcrumb! Changed this

Code:
$breadcrumb =~ s/(.*?<span class\=\"cpshopbreadcrumbtext\">)(.*)(<\/span>.*$)/@{[clean_product_name($hash_ref,$2,$producttypeno,$1,$3)]}/si;

to this

Code:
$breadcrumb =~ s/(.*?<span class\=\"cpshopbreadcrumbtext\">)(.*)(<\/span>.*$)/@{[clean_product_name(\%product_names,$2,$producttypeno,$1,$3)]}/si;

And I got it to work in my hacked lib file.


Ooop! My bad! Sorry about that!
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: Product Type Numbers String = "Product Typ" ou
« Reply #61 on: 12/12/11 at 23:09:50 »
Reply with quote Modify message



on 12/10/11 at 15:55:29, brattytees wrote:
You know, I was reading this other thread about changing the breadcrum trail and I saw this
It doesn't appear in mine twice as I posted above.


<grin> -- it has been so long since I hacked that file... I forgot that the original state of the hacked section was empty.
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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #62 on: 12/13/11 at 13:55:20 »
Reply with quote Modify message



on 12/12/11 at 23:06:35, Hex Angel - Patrick wrote:
Ooop! My bad! Sorry about that!

That's ok, I was running low on things to bang my head against the wall for.

And I got the productname that I use in the page title to untruncate too. I think that fixes all those issues on both the thumbnail pages and product pages. So now I'm bored.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #63 on: 12/13/11 at 13:58:17 »
Reply with quote Modify message



on 12/12/11 at 23:09:50, Hex Angel - Patrick wrote:
<grin> -- it has been so long since I hacked that file... I forgot that the original state of the hacked section was empty.

What's funny is when I added the stuff from the unhacked section to the hacked section just because I'll try anything...and tried some things, they worked...with hacked set to 1.  Oh well, so be it. I'm not going to lose sleep over it.
Logged
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Product Type Numbers String = "Product Typ" ou
« Reply #64 on: 12/13/11 at 20:14:17 »
Reply with quote Modify message

Doooh!
~ Homer Simpson

<smile>

Glad it's all working now!
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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #65 on: 12/14/11 at 16:27:02 »
Reply with quote Modify message

Thanks for kickstart code and help with this!! It beats all the different regex combos I had trying to deal with it all. I don't mind a challenge with regex now and then, but after awhile enough is enough, ya know?

Now, what's the next project?
Logged
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Product Type Numbers String = "Product Typ" ou
« Reply #66 on: 12/14/11 at 18:25:02 »
Reply with quote Modify message

<grin> Well, now that we have a product database, I was thinking it's extremely easy to put a css popup featuring the back image of any two-sided product.
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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #67 on: 12/14/11 at 19:02:01 »
Reply with quote Modify message

Hmmm, I used to do two sided for some themes, but since the prices have gotten ridiculous I stopped. But since you already have that popup going on on your site you're halfway there.

I was thinking I might try to figure how to integrate the original subject of this thread (lol) into the hash table, wondering which would be more efficient, the way I have it now or converting it. Here's how I have it now, wonder what you think?

Code:
...
if (($producttypeno == 4)||($producttypeno == 135)||($producttypeno == 249)) {
     $html =~ s/<\[producttypenumber\]>/Sweatshirt/g;
} if (($producttypeno == 38)||($producttypeno == 136)) {
     $html =~ s/<\[producttypenumber\]>/Jersey/g;
} else {
     $html =~ s/<\[producttypenumber\]>/T-Shirt/g;
}

etc. I think there's a total of 14 IFs right now and some of the ifs have 5, 6, 7 and one I think has 12 ORs. Yeah, really.
« Last Edit: 12/14/11 at 19:05:14 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #68 on: 12/14/11 at 19:12:40 »
Reply with quote Modify message

I guess I should add I only have the longer products in my hash table, only about 10 or so, so I'd have to add each and every one to it to do what I'm doing with the code above, that might make a difference.
Logged
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Product Type Numbers String = "Product Typ" ou
« Reply #69 on: 12/14/11 at 20:46:39 »
Reply with quote Modify message

I suppose whether or no depends on how much time you're willing to spend for an incremental increase in efficiency.

Generally a single hash table lookup will be *much* more efficient than that cascading decision statement. The cascade gets called once for every product thumbnail on a page, I take it?

On the other hand, eliminating just one string replacement instruction on $html or $content would likely have a greater effect on overall efficiency.

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: Product Type Numbers String = "Product Typ" ou
« Reply #70 on: 12/14/11 at 20:50:10 »
Reply with quote Modify message

Oh, btw, you could rewrite that whole cascade as a switch statement, which would be more efficient than all those ifs, without having to extend your hash and rewrite a whole bunch of code.

See: http://perl.active-venture.com/lib/Switch.html
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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #71 on: 12/15/11 at 16:14:29 »
Reply with quote Modify message



on 12/14/11 at 20:46:39, Hex Angel - Patrick wrote:
Generally a single hash table lookup will be *much* more efficient than that cascading decision statement. The cascade gets called once for every product thumbnail on a page, I take it?

Actually that brings up a good point I hadn't thought about, because actually I'm only using it on the product pages for seo.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #72 on: 12/15/11 at 16:26:37 »
Reply with quote Modify message



on 12/14/11 at 20:50:10, Hex Angel - Patrick wrote:
Oh, btw, you could rewrite that whole cascade as a switch statement, which would be more efficient than all those ifs, without having to extend your hash and rewrite a whole bunch of code.

Ugh! I guess it's finally time to dive into that, huh? I've always sort of shied away from it, but I have some php stuff that could benefit from it too that I just never got around to messing with, although php is so much friendlier than perl, imo. Thanks for the suggestion! If you hear some banging it's just my head and the wall.
Logged
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: Product Type Numbers String = "Product Typ" ou
« Reply #73 on: 12/15/11 at 20:08:41 »
Reply with quote Modify message

<grin>  I resort to switch statements when I'm being lazy ... or avoiding learning something new in an arcane language like PERL -- EG: hash tables. But a hash table is way more efficient than a decision tree; more efficient than a switch, especially in PERL because there's no library to import -- and easier to maintain than both. And once I've bothered to create one, I often find more uses for it.

PHP is a lot more Pascal like than the than the C+ on uppers that is PERL. But the more I work with PERL, the more I like it... for things like calling a subroutine to work on a match in a string replacement statement. Very cool. =)
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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #74 on: 12/16/11 at 15:15:48 »
Reply with quote Modify message

Lol, I took a php decision tree and turned it into a switch statement in only a few minutes, simple and sweet. The Perl stuff I spent way too much time reading about all the different ways to do it (yes, there should always be half a dozen ways to do the same thing just to confuse the issue) and if you have Perl greater than this or less than this and blah blah blah and finally said "I think I'll leave it how it is for now, it works". Then I went to Buffalo Wild Wings and had some wings and beer and watched the Hurricanes win for a change and my head felt better. Actually in the end I'll probably incorporate it into the hash table, that seems to be the most efficient way.

Oh, and in the mean time I discovered the all the fixes I did for the jumpy swatch rollovers didn't work in IE (7 at least) so I beat my head against the wall some more. Turns out even though productarea is > than 635 (or whatever it needs to be) to get the larger image, IE doesn't get it, so you have to cram it down IEs throat in the CSS that productarea is actually greater than 635. Doh!!! I hate IE and wish it would just go away already.
Logged
Pages: « 1 2 3 4 5 6 » 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.