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/12/17 at 17:42:12
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 9302 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 #15 on: 12/08/11 at 17:39:58 »
Reply with quote Modify message



on 12/08/11 at 17:12:25, brattytees wrote:
ETA - I just now thought of something, I'm running your code (and some of my hacks) out of a lib file and that could be the cause of some things not changing...wait, no, the lib file is linked to cpdata but not cppage so that shouldn't be the issue right here. I need to think about this.


Mmmm.... I link from cpshop.cgi directly...  (cpshop.cgi *never* changes so I  don't have to worry about putting that line of code back in after an upgrade) ... but where we link from shouldn't make a difference.
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 #16 on: 12/08/11 at 18:22:27 »
Reply with quote Modify message



on 12/07/11 at 17:35:11, brattytees wrote:
1. I changed this one
'184' => { 'target' => 'Neck Dar', 'replace' => 'Neck Dark T-shirt' }, #Plus Size Scoop


Try changing 'Neck Dar' to 'Neck Da' ...

The truncated string ends on "....Neck Da' which makes me think maybe we're running into a boundary condition on that one.

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 #17 on: 12/08/11 at 19:32:58 »
Reply with quote Modify message



on 12/08/11 at 17:33:53, Hex Angel - Patrick wrote:
Have you tried tossing a die in sub clean_product_name ? Something like this inside the decision statement.


Code:
my $temp = $productname;

$productname =~ s/^(.*)$product_names{$producttypeno}->{'target'}.*?$/$1$product_names{$producttypeno}->{'replace'}/; # this is one line of code

if ( $producttypeno eq "184" ) {
die ' before ' . $temp . '  after ' . $productname;
}


That should tell us whether the code's ever being called corrrectly, and perhaps why it's not doing what we expect.

Thanks! Looks to be working, I get

before Naughty, Spank Me Women's Plus Size Scoop Neck Dar  after Naughty, Spank Me Women's Plus Size Scoop Neck Dark T-Shirt
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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



on 12/08/11 at 17:39:58, Hex Angel - Patrick wrote:
Mmmm.... I link from cpshop.cgi directly...  (cpshop.cgi *never* changes so I  don't have to worry about putting that line of code back in after an upgrade) ... but where we link from shouldn't make a difference.

Well yeah, same thing different way, Marty suggested the lib file awhile ago so I wouldn't have to redo all my hacks everytime an update came out. It works really well most of the time and it's only one file I need to worry about, I have like 15 instances of cpshop running, so I'd have to go through and update 15 versions of cpshop.cgi everytime I made a change. Only thing is like I said it's only tied to cpdata, so if I need to hack cppage I've still got another file to deal with, but that's still less than 15.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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



on 12/08/11 at 18:22:27, Hex Angel - Patrick wrote:
Try changing 'Neck Dar' to 'Neck Da' ...

The truncated string ends on "....Neck Da' which makes me think maybe we're running into a boundary condition on that one.


That may have been it. It seemed to work and not effect anything else. But I've since discovered a long product name I overlooked, so now I had to back them all up to ...'Plus Size' and they all seem to work ok on the thumbnail page so far. Still wondering the best way to deal with the alt and title (not page title) tags on those pages though.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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

Would you do me a favor and look at this even though I may not need it now anyway. It's driving me crazy and I've been staring at it for 2 days now and by now may be overlooking the obvious, like the other day when I deleted a pipe in the match portion by accident and it took me hours to see it. It was for fixing the product page description and it works for the dark shirts but not for the light shirts.  

Code:
if ($table =~ m|("\|>)(.*)Women's Plus Size (Scoop \|V-)Neck (Dark\|Dar\|Da\|D)([^<]*)("\|<)|) {
                 $table =~ s|("\|>)(.*)Women's Plus Size (Scoop \|V-)Neck (?:Dark\|Dar\|Da\|D)([^<]*)("\|<)|$1$2Women's Plus Size $3Neck Dark T-Shirt$5|i;
           } else {
                 $table =~ s|("\|>)(.*)Women's Plus Size (Scoop \|V-)N([^<]*)("\|<)|$1$2Women's Plus Size $3Neck T-Shirt$5|i;
           }
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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

Ok, is this a glitch or is there a reason why on your Give Peace A Chance Happy Christmas page many of the descriptions are truncated in the middle of the line like Give Peace A Chance Happy Chr Men's Dark T-Shirt?
« Last Edit: 12/08/11 at 21:11:53 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 #22 on: 12/08/11 at 21:36:14 »
Reply with quote Modify message



on 12/08/11 at 21:11:14, brattytees wrote:
Ok, is this a glitch or is there a reason why on your Give Peace A Chance Happy Christmas page many of the descriptions are truncated in the middle of the line like Give Peace A Chance Happy Chr Men's Dark T-Shirt?


hey!  That's funky! lol -- I'll have to figure that one out. Maybe that has something to do with your issue?
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 #23 on: 12/08/11 at 21:38:40 »
Reply with quote Modify message



on 12/08/11 at 19:49:16, brattytees wrote:
That may have been it. It seemed to work and not effect anything else. But I've since discovered a long product name I overlooked, so now I had to back them all up to ...'Plus Size' and they all seem to work ok on the thumbnail page so far. Still wondering the best way to deal with the alt and title (not page title) tags on those pages though.


Which alt and 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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Product Type Numbers String = "Product Typ" ou
« Reply #24 on: 12/08/11 at 21:57:20 »
Reply with quote Modify message


on 12/08/11 at 21:38:40, Hex Angel - Patrick wrote:
Which alt and title?

The stuff I posted back on the first page

Page source snippet

<div class="thmbgridcellcontainer">
    <div><a href="http://www.brattytees.com/cgi-bin/store/holiday-tees.cgi/ive_been_naughty_spank_me/naughty_spankme.491756581"><img border="0" height="150" oldwidth="150" src="http://images1.cpcache.com/product/491756581v4_150x150_Front_Color-Black.jpg" alt="Naughty, Spank Me Women's Plus Size Scoop Neck Dar" title="Naughty, Spank Me Women's Plus Size Scoop Neck Dar"></a></div>
    <img src="/img/swatches/type-184.png" width=150 height=15 border=0 alt="color swatch" style="margin: 2px 0;">
    <div class="thumbpagelink"><a href="http://www.brattytees.com/cgi-bin/store/holiday-tees.cgi/ive_been_naughty_spank_me/naughty_spankme.491756581">Naughty, Spank Me Women's Plus Size Scoop Neck Dark T-Shirt</a><br>
    $30.99</div>
</div>
« Last Edit: 12/08/11 at 22:00:16 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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



on 12/08/11 at 21:36:14, Hex Angel - Patrick wrote:
hey!  That's funky! lol -- I'll have to figure that one out. Maybe that has something to do with your issue?

Could be. What's really weird is it's in the middle of the line, not at the end, and it's only some of them.
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 #26 on: 12/08/11 at 22:06:22 »
Reply with quote Modify message

Oh!  Silly me... Didn't really see what you were asking the first time.

Undocumented cpshop tag <[linksrc]>


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>


[smile]
« Last Edit: 12/08/11 at 22:08:26 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: Product Type Numbers String = "Product Typ" ou
« Reply #27 on: 12/08/11 at 22:26:53 »
Reply with quote Modify message


on 12/08/11 at 21:11:14, brattytees wrote:
Ok, is this a glitch or is there a reason why on your Give Peace A Chance Happy Christmas page many of the descriptions are truncated in the middle of the line like Give Peace A Chance Happy Chr Men's Dark T-Shirt?


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.

This is how it looks in the CP marketplace: http://www.cafepress.com/+give_peace_a_chance_happy_chr_organic_womens_tsh,386910009
« Last Edit: 12/08/11 at 22:29:31 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: Product Type Numbers String = "Product Typ" ou
« Reply #28 on: 12/08/11 at 22:35:38 »
Reply with quote Modify message


on 12/08/11 at 19:52:54, brattytees wrote:

Code:
if ($table =~ m|("\|>)(.*)Women's Plus Size (Scoop \|V-)Neck (Dark\|Dar\|Da\|D)([^<]*)("\|<)|) {
                 $table =~ s|("\|>)(.*)Women's Plus Size (Scoop \|V-)Neck (?:Dark\|Dar\|Da\|D)([^<]*)("\|<)|$1$2Women's Plus Size $3Neck Dark T-Shirt$5|i;
           } else {
                 $table =~ s|("\|>)(.*)Women's Plus Size (Scoop \|V-)N([^<]*)("\|<)|$1$2Women's Plus Size $3Neck T-Shirt$5|i;
           }

<grin> Can't tell you how many times I've sweat some arcane regex error... just yesterday, in fact.

Can't tell you what's wrong there, except it must be happening somewhere in


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


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

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'.
« Last Edit: 12/08/11 at 22:36:38 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
brattytees
Gold Dragon
****

Posts: 439



ack!
   

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

<[linksrc]> Really?  Lol, thanks!!  
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.