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/18/17 at 18:42:39
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 9413 times)
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #30 on: 12/08/11 at 22:50:36 »
Reply with quote Modify message



on 12/08/11 at 22:35:38, Hex Angel - Patrick wrote:

Code:
N([^<]*)("\|<)


Shouldn't '|<' in there be '|>'  ?


I always have to stop and think about that and look at it, but no, it needs to be a < if you look it makes sense

Code:
N([^<]*)("\|<)

And I just added the " and the OR, it used to just be a plain < , but I was starting to work on fixing the alt and title tags like we were just talking about which is were the " came in, but it didn't work before I added them either. And actually the way I have it now (with the ") should really be

Code:
N([^<\|"]*)("\|<)

But that won't stop it from working on the product page anyway for just the product description.

Quote:
It's the same in the working code above it. But... Maybe it's one of those 'just because it seems to be working doesn't mean it's working correctly'.

Lol, yeah, for sure. Oh well, thanks, I may not need that at all now, but I just wanted to satisfy myself that there wasn't something staring me in the face that I just couldn't see.

Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #31 on: 12/09/11 at 16:23:34 »
Reply with quote Modify message


on 12/08/11 at 22:26:53, Hex Angel - Patrick wrote:
Heh -- that's one of my affiliates' products ... they inconsistently name their products.  What cpshop served me up was "Give Peace A Chance Happy Chr Organic Women's T-Sh", so the code fixed what it could.

Yeah, I got to thinking it was something like that.

Quote:
This is how it looks in the CP marketplace: http://www.cafepress.com/+give_peace_a_chance_happy_chr_organic_womens_tsh,386910009

That's just a piece of art right there now. At least Cp finally figured it out, or just got lucky, and shortened up the names in the MP, but some are still truncated.
« Last Edit: 12/09/11 at 16:26:57 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #32 on: 12/09/11 at 16:35:19 »
Reply with quote Modify message

Ok, so I finally got done wresting with the thumbnail page and it looks like everything on it is finally  fixed. Yippe!!!! Thank you!!!

So now I'm playing with the product page which involves the product desc, the breadcrumb, and the page title. Can't get it to work. I tried dumping your code (including breadcrumb) directly into cpshop.cgi and nothing. No changes. The only thing it did was make the product desc huge, since they have it as a h1 and I had to kill my regex that had made that h1 an h2 since I have my own h1 farther up the page and it's really not ideal to have two h1s on a page. Yes, I know I can change the size with css, but I'd prefer it be a h2 there.

« Last Edit: 12/09/11 at 16:36:04 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #33 on: 12/09/11 at 18:04:38 »
Reply with quote Modify message

So it looks like I've got the product descriptions fixed on the product pages, or it seems so at the moment, and I got them back to an h2 on top of that, (although I think there's a better way to do that), but I'm not really 100% certain how the product desc got fixed, I'm just not sure how it's working and I like to know these things.

I still can't get the breadcrumb to change no matter what and then there's the page title which I've hardly messed with yet.

But we're making some progress.
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 #34 on: 12/09/11 at 18:13:31 »
Reply with quote Modify message



on 12/09/11 at 16:35:19, brattytees wrote:
Ok, so I finally got done wresting with the thumbnail page and it looks like everything on it is finally  fixed. Yippe!!!! Thank you!!!


[smile] Noice! (As the Aussie's would say)


Quote:
So now I'm playing with the product page which involves the product desc, the breadcrumb, and the page title. Can't get it to work. I tried dumping your code (including breadcrumb) directly into cpshop.cgi and nothing. No changes. The only thing it did was make the product desc huge, since they have it as a h1 and I had to kill my regex that had made that h1 an h2 since I have my own h1 farther up the page and it's really not ideal to have two h1s on a page. Yes, I know I can change the size with css, but I'd prefer it be a h2 there.


lol -- I never even thought to use header tags for general text... sneaky! I wonder if Google detects the length -- and whether it cares?

Post the relevant sections of templates, page source and code. Let's have a look.
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 #35 on: 12/09/11 at 18:38:29 »
Reply with quote Modify message

Actually I found thumbsrc, too, so this

Code:
<div class="thmbgridcellcontainer">
   <div><a href="<[linksrc]>" alt= "<|clean_product:<[productname]>|<[producttypeno]>|>" title="<|clean_product:<[productname]>|<[producttypeno]>|>"><[thumbnail]></a></div>
   <img src="/img/swatches/type-<[producttypeno]>.png" width=150 height=15 border=0 alt="color swatch" style="margin: 2px 0;">
   <div class="thumbpagelink"><a href="<[linksrc]>" alt= "<|clean_product:<[productname]>|<[producttypeno]>|>" title="<|clean_product:<[productname]>|<[producttypeno]>|>"><|clean_product:<[productname]>|<[producttypeno]>|><[linkends]><br>
   <[productcost]></div>
</div>

Should be more like this

Code:
<div class="thmbgridcellcontainer">
     <div><a href="<[linksrc]>"><img border="0" height="150" width="150" src="<[thumbsrc]>" alt="<|clean_product:<[productname]>|<[producttypeno]>|>" title="<|clean_product:<[productname]>|<[producttypeno]>|>"></a></div>
     <img src="/img/swatches/type-<[producttypeno]>.png" width="150" height="15" border="0" alt="color swatch" style="margin: 2px 0;">
     <div class="thumbpagelink"><[linkstarts]><|clean_product:<[productname]>|<[producttypeno]>|><[linkends]><br>
     <[productcost]></div>
</div>

Otherwise your alt and title tags are outside the image tag.
« Last Edit: 12/09/11 at 18:39:17 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #36 on: 12/09/11 at 18:45:07 »
Reply with quote Modify message



on 12/09/11 at 18:13:31, Hex Angel - Patrick wrote:
lol -- I never even thought to use header tags for general text... sneaky! I wonder if Google detects the length -- and whether it cares?

Well, I'm not really using it for general text, I wonder about that too, lengthwise. It's really a variation of the product name string for seo purposes.

Quote:
Post the relevant sections of templates, page source and code. Let's have a look.

Ok, let me regroup and put everything back together first.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #37 on: 12/09/11 at 19:00:38 »
Reply with quote Modify message

Template breadcrumb

Code:
<TD><[breadcrumb]>
<DIV class="content"><[content]></DIV></TD>

Page source breadcrumb truncated

Code:
<p class=cpshopbreadcrumb><nobr><a class="cpshopbreadcrumblink" href="http://www.brattytees.com/">Home</a></nobr> &gt; <nobr><a class="cpshopbreadcrumblink" href="http://www.brattytees.com/cgi-bin/store/holiday-tees.cgi/">Women's and Girls Holiday T-Shirts</a></nobr> &gt; <nobr><a class="cpshopbreadcrumblink" href="http://www.brattytees.com/cgi-bin/store/holiday-tees.cgi/ive_been_naughty_spank_me">I've Been Naughty, Spank Me tee</a></nobr> &gt; <nobr><span class="cpshopbreadcrumbtext">Naughty, Spank Me Women's Plus Size V-Neck Dark T-</span></nobr></p>

Page source product name (fixed)

Code:
<h2 class="productCaption">Naughty, Spank Me Women's Plus Size V-Neck Dark T-Shirt</h2>

Partial hash table

Code:
'183' => { 'target' => 'Plus Size', 'replace' => 'Plus Size Scoop Neck T-Shirt' }, #Plus Size Scoop
'184' => { 'target' => 'Plus Size', 'replace' => 'Plus Size Scoop Neck Dark T-Shirt' }, #Plus Size Scoop Dark
'185' => { 'target' => 'Plus Size', 'replace' => 'Plus Size V-Neck T-Shirt' },
'186' => { 'target' => 'Plus Size', 'replace' => 'Plus Size V-Neck Dark T-Shirt' }, #Plus Size V Dark

Then your sub clean_product_name

Then

Code:
$breadcrumb =~ s/(.*?<span class\=\"cpshopbreadcrumbtext\">)(.*)(<\/span>.*$)/@{[clean_product_name($hash_ref,$2,$producttypeno,$1,$3)]}/si;  # careful, this is all one line!
$content =~ s/<\|clean_product:(.*?)\|(.*?)\|>/@{[clean_product_name(\%product_names,$1,$2,"","")]}/sgi; # this is one line
$content =~ s/(<div id\=\"productCaption\" class\=\"pageTitle head\"><h1>)(.*?)(<\/h1>)/@{[clean_product_name(\%product_names,$2,$producttypeno,$1,$3)]}/si; # product detail title
$content =~ s|<div id="productCaption" class="pageTitle head"><h1>(.*?)</h1></div>|<div id="productCaption" class="pageTitle head"><h2 class="productCaption">$1</h2></div>|;
1;

The last line is my workaround to replace the h1's with h2's for now.

So the above code is in my lib file, but like I said, I tried dumping it into cpshop cgi and it didn't make any difference. I also tried rearranging things in the cgi file to no avail.
« Last Edit: 12/09/11 at 19:01:24 by brattytees » 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 #38 on: 12/09/11 at 19:02:31 »
Reply with quote Modify message



on 12/09/11 at 18:38:29, brattytees wrote:
1> Actually I found thumbsrc, too,

[snip]

2> Otherwise your alt and title tags are outside the image tag.


1> <grin> Thumbsrc is documented... I wondered why there was no linksrc, so I was going to hack the cpshop libs to make one, when I found it.

2> lol -- I think that was hour 36 or so. <grin>

Seriously, though, looking at it now, if you put the title element back in the anchor tag I think you get the same result visually, and it may or may not be slightly better SEO since you're moving the keywords into different elements.  (I like using titles on anchors in general -- gives you an opportunity to spin a synonym into the SEO, and also to say something to the user about where they'll be going.)
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 #39 on: 12/09/11 at 19:13:51 »
Reply with quote Modify message

Oh, right. We're both forgetting something I mentioned elsewhere.

cpshop fills in the breadcrumb in the call to &gettemplate;  (put a die $html; right after the call -- surprised me too.)

So there is no <[breadcrumb]> in $html for to replace.

So, use <|breadcrumb|> in your template instead, and replace 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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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



on 12/09/11 at 19:02:31, Hex Angel - Patrick wrote:
Seriously, though, looking at it now, if you put the title element back in the anchor tag I think you get the same result visually, and it may or may not be slightly better SEO since you're moving the keywords into different elements.  (I like using titles on anchors in general -- gives you an opportunity to spin a synonym into the SEO, and also to say something to the user about where they'll be going.)

You know you're right, I wasn't even thinking that way. Alt and title are redundant in the image tag and that's not really what title is for. It's much better and more suited to the a tag and other things. Need to fix that. Thank you.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #41 on: 12/09/11 at 19:31:08 »
Reply with quote Modify message



on 12/09/11 at 19:13:51, Hex Angel - Patrick wrote:
Oh, right. We're both forgetting something I mentioned elsewhere.

cpshop fills in the breadcrumb in the call to &gettemplate;  (put a die $html; right after the call -- surprised me too.)

So there is no <[breadcrumb]> in $html for to replace.

So, use <|breadcrumb|> in your template instead, and replace that.

Oh, oops!!! Never thought about that. Let's see how that works.
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 #42 on: 12/09/11 at 19:34:36 »
Reply with quote Modify message



on 12/09/11 at 19:00:38, brattytees wrote:
[snip]

Page source product name (fixed)

Code:
<h2 class="productCaption">Naughty, Spank Me Women's Plus Size V-Neck Dark T-Shirt</h2>


[snip]

Then

Code:
[snip]
$content =~ s/<\|clean_product:(.*?)\|(.*?)\|>/@{[clean_product_name(\%product_names,$1,$2,"","")]}/sgi; # this is one line
$content =~ s/(<div id\=\"productCaption\" class\=\"pageTitle head\"><h1>)(.*?)(<\/h1>)/@{[clean_product_name(\%product_names,$2,$producttypeno,$1,$3)]}/si; # product detail title
$content =~ s|<div id="productCaption" class="pageTitle head"><h1>(.*?)</h1></div>|<div id="productCaption" class="pageTitle head"><h2 class="productCaption">$1</h2></div>|;
1;

The last line is my workaround to replace the h1's with h2's for now.

So the above code is in my lib file, but like I said, I tried dumping it into cpshop cgi and it didn't make any difference. I also tried rearranging things in the cgi file to no avail.


Oh ... i just noticed the 1; .... is this code appearing just before the last line of the cpshop.cgi file? If it is, it's not getting executed.

In the (fixed) page source, did you take out the class when you fixed it?

Also, i think you could save yourself one search through the content if you rewrote the clean_product_name call this way, and replace the h2 tags with it.


Code:
$content =~ s/(<div id\=\"productCaption\" class\=\"pageTitle head\"><h1>)(.*?)(<\/h1>)/@{[clean_product_name(\%product_names,$2,$producttypeno,'<div id="productCaption" class="pageTitle head"><h2 class="productCaption">','</h2></div>')]}/si; # product detail title

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 #43 on: 12/09/11 at 19:38:52 »
Reply with quote Modify message



on 12/09/11 at 19:28:01, brattytees wrote:
You know you're right, I wasn't even thinking that way. Alt and title are redundant in the image tag and that's not really what title is for. It's much better and more suited to the a tag and other things. Need to fix that. Thank you.


<smile> No worries. I need to be more diligent about that myself.

Of course, I believe IE doesn't pop-up alt tags, only title tags -- so with un-anchored image files, I try to remember to use both.
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 #44 on: 12/09/11 at 20:00:24 »
Reply with quote Modify message



on 12/09/11 at 19:34:36, Hex Angel - Patrick wrote:
Oh ... i just noticed the 1; .... is this code appearing just before the last line of the cpshop.cgi file? If it is, it's not getting executed.


Actually I copied that out of the lib file. I have too many things going on. When I put it directly in the cpshop.cgi file I put that part above &gettemplate and the sub clean_product_name directly above the 1;

I trying to do too much at once.
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.