You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I'm using my own images for the best sellers and I want to link to the page with those items (same for new products). How do I do that? Thanks!
Offline
The ccp php line of
$this->include_namespace('app','namespace',array());
where app is the namespace's app and namespace is the namespace you want to call, so (example ecom.catshow)
$this->include_namespace('ecom','catshow',array());
will pull the categories for display. But this will execut the namespace and if used on or for the best sellers will not insert any other image than listed in the porducts information or that is stored within your ccp directory because that's all the original script is set to do.
an example to pull a product is
$this->include_namespace('ecom','prodshow',array('ref' => 'product_id'));
John
Offline
Hm. Well, I don't want to pull up the namespace, but just the link to the page it generates.
Offline
Well, yes. A static image, to be specific. But I want to link to best sellers and new stuff.
Offline
It seems you just want to create a xhtml link.
Offline
I want a link that looks something like this:
<a href="[link to best sellers]"><img src="[my image]"></a>
Offline
<a href="index.php?app=ecom&ns=prodbest" title="Best Sellers"><img src="some-image.jpg" alt="whatever"></a>
Offline
Is the page within ccp (created when the site is accessed) or is it out side of ccp? You can hardcode the link
<a href="http://www.sitename.com/index.php?&app=ecom&ns=prodbest" title="your_title"><img src="your_image"></a>
within ccp (php script)
$link =$this->link_namespace('ecom','prodbest',array()); print '<a href="' . $link . '" title="best seller"><img src="your_image"></a>';
inside html page (within ccp)
<?php $link =$this->link_namespace('ecom','prodbest',array()); ?> <a href="<?php print $link; ?>" title="your_title"><img src="your_image"></a>
John
John
Last edited by dh783 (06-22-2010 13:30:01)
Offline
dh783 wrote:
Code:
<?php $link =$this->link_namespace('ecom','prodbest',array()); ?> <a href="<?php print $link; ?>" title="your_title"><img src="your_image"></a>
John, how would you code a product link? I have set up hard-coded links to free samples in the long product descriptions in the format of: index.php?app=ecom&ns=prodshow&ref=free_sample and of course, I realize now that they will not rewrite when SEO is on.
Offline
The problem here is that the long description isn't set up to execute php code within its field but a product link would be
<?php $link = $this->link_namespace('ecom','prodshow',array('ref' => 'product_id')); ?> <a href="<?php print $link; ?>" title="your_title"><img src="your_image"></a>
also if you used & in your hard link you need to change it & amp; (no space) to get it to validate.
John
Last edited by dh783 (06-22-2010 14:24:10)
Offline
susan2go wrote:
Code:
<a href="index.php?app=ecom&ns=prodbest" title="Best Sellers"><img src="some-image.jpg" alt="whatever"></a>
This is not the way to do it properly, because SEO links will not work once you enable SEO. The link will work, but there's some unforeseen downsides. Hope this helps!
Offline
jj1987 wrote:
This is not the way to do it properly, because SEO links will not work once you enable SEO. The link will work, but there's some unforeseen downsides. Hope this helps!
Nice doubles, dude.
She said she needed a link from a static .html page? I have no idea why she wants to do it that way.
Offline
dh783 wrote:
The problem here is that the long description isn't set up to execute php code within its field but a product link would be
Code:
<?php $link = $this->link_namespace('ecom','prodshow',array('ref' => 'product_id')); ?> <a href="<?php print $link; ?>" title="your_title"><img src="your_image"></a>John
It won't execute in that space. When I view the source, the link is printed verbatim:
<a href="<?php print $link; ?>" title="Free Sample">Get a Free Sample!</a>
and everything except "<?php" and "?>" in the following
$link = $this->link_namespace('ecom','prodshow',array('ref' => 'product_id'));
is also printed verbatim.
I can use the already rewritten url hard links I suppose.
Offline
If you want to run php in the long description then replace this line in your product detail displays
<?php print $proddesc; ?>
with this
<?php $this->include_phptext($proddesc); ?>
Have tested this and haven't seen any problems yet with items with no html or php in them.
John
Offline
susan2go wrote:
jj1987 wrote:
This is not the way to do it properly, because SEO links will not work once you enable SEO. The link will work, but there's some unforeseen downsides. Hope this helps!
Nice doubles, dude.
She said she needed a link from a static .html page? I have no idea why she wants to do it that way.
Well, you can still link from a static page that way.
Offline