Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping v4.x

Ceon URI Mapping v4.x

Views: 451,968

Results 2,161 to 2,180 of 2,454
11 Oct 2017, 1:16 PM
#2161
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Ceon URI Mapping v4.x

If I put a store with this mod in a subdirectory, none of the URIs work anymore.

mysite.com/Category works fine but
mysite.com/upgrade/Category fails

Has anyone else dealt with this?

11 Oct 2017, 1:39 PM
#2162
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

swguy:

If I put a store with this mod in a subdirectory, none of the URIs work anymore.

mysite.com/Category works fine but
mysite.com/upgrade/Category fails

Has anyone else dealt with this?

Assumption for the below is that after the move, the uri for the associated failing product has not been regenerated. This is as compared to moving the store into a directory, creating a new uri and that uri failing. I am below addressing the first situation, not the second based on my understanding of the question and condition(s) provided.

Yes. By moving the store into or out of a directory, the uris have technically changed and need to be created/recreated as the new active uris with the old active uris made not-current so that the old links will still direct to/reach the now current uri of the same product.

This is one reason that it is recommended when pre-creating a store or when testing operation that a sub-domain having the same directory structure of the end store is recommended. In this way, effectively the HTTP_SERVER changes but not the DIR_WS_CATALOG.

11 Oct 2017, 1:55 PM
#2163
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

mc12345678:

Yes. By moving the store into or out of a directory, the uris have technically changed and need to be created/recreated as the new active uris with the old active uris made not-current so that the old links will still direct to/reach the now current uri of the same product.

You have to rerun the ceon_uri_mapping_installation_check.php. I get that. But after updating my .htaccess, I'm still getting 404s with every combination of the final rewrite rule.

RewriteRule .* /my_site/index.php [QSA,L]
RewriteRule .* my_site/index.php [QSA,L]
RewriteRule .* /index.php [QSA,L]
RewriteRule .* index.php [QSA,L]

and I'm not sure how to debug that.

11 Oct 2017, 2:24 PM
#2164
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

swguy:

You have to rerun the ceon_uri_mapping_installation_check.php. I get that. But after updating my .htaccess, I'm still getting 404s with every combination of the final rewrite rule.

RewriteRule .* /my_site/index.php [QSA,L]
RewriteRule .* my_site/index.php [QSA,L]
RewriteRule .* /index.php [QSA,L]
RewriteRule .* index.php [QSA,L]

and I'm not sure how to debug that.

Does the sub-directory also have an .htaccess as a result of the move?

17 Oct 2017, 7:26 AM
#2165
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I have another problem, I have a slide in the home that takes the product id from the db, if I read the source code I notice that the link of the category or the product link is not generated by ceon uri I products = id etc. clicking does a normal thing, but SEOs have links on the page with rederict 301 is not the best. How can I do to generate the correct links without cpath etc.

$productlink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=product_info&cPath='.$cpath.'&products_id='.$products_id;
$showmorelink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=index&cPath='.$cpath;

<a href="<?php echo $productlink; ?>"><span class="a-btn-text">Buy now</span></a>
<a href="<?php echo $showmorelink; ?>"><span class="a-btn-slide-text">More</span></a>

17 Oct 2017, 7:57 AM
#2166
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Ceon URI Mapping v4.x

diamond1:

I have another problem, I have a slide in the home that takes the product id from the db, if I read the source code I notice that the link of the category or the product link is not generated by ceon uri I products = id etc. clicking does a normal thing, but SEOs have links on the page with rederict 301 is not the best. How can I do to generate the correct links without cpath etc.

$productlink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=product_info&cPath='.$cpath.'&products_id='.$products_id;
$showmorelink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=index&cPath='.$cpath;

<a href="<?php echo $productlink; ?>"><span class="a-btn-text">Buy now</span></a>
<a href="<?php echo $showmorelink; ?>"><span class="a-btn-slide-text">More</span></a>
replying from my phone, so I can not give the right syntax, but you should use the zen_href_link function, instead of the hardcoded link.

17 Oct 2017, 8:05 AM
#2167
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi, you can give me an example

17 Oct 2017, 8:07 AM
#2168
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

When you can of course hihih

18 Oct 2017, 10:56 PM
#2169
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Torvista can you help me? do I get the solution?

19 Oct 2017, 1:06 AM
#2170
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

To maximize the possible operation, I think this will accomplsh what was requested:

$productlink = zen_href_link(zen_get_info_page($products_id), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev(zen_get_products_category_id($products_id)) . '&products_id=' . $products_id);
    $cPath_new = 'cPath=' . $_GET['cPath'];
    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new); 
19 Oct 2017, 5:37 AM
#2171
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I should not get a white page.

19 Oct 2017, 10:24 AM
#2172
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

mc12345678:

To maximize the possible operation, I think this will accomplsh what was requested:

$productlink = zen_href_link(zen_get_info_page($products_id), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($GET['cPath']) : zen_get_generated_category_path_rev(zen_get_products_category_id($products_id)) . '&products_id=' . $products_id);
$cPath_new = 'cPath=' . $GET['cPath'];
// strip out 0
from top level cats
$cPath_new = str_replace('=0
', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new);



A closing parenthesis was missing from the first line:

$productlink = zen_href_link(zen_get_info_page($products_id), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($GET['cPath']) : zen_get_generated_category_path_rev(zen_get_products_category_id($products_id)) . '&products_id=' . $products_id)[B])[/B];
$cPath_new = 'cPath=' . $GET['cPath'];
// strip out 0
from top level cats
$cPath_new = str_replace('=0
', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new);


In the future, please remember that a blank screen will more than likely have generated a myDebug log in the logs folder as identified in this FAQ: <https://www.zen-cart.com/content.php?124-blank-page>
19 Oct 2017, 11:05 AM
#2173
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

No
it remains as it does before but does not show rewriting

<a href="https://mozit:8890/index.php?main_page=product_info&cPath=7&products_id=33"><span class="a-btn-text">Buy</span></a> <a href="https://mozit:8890/index.php?main_page=index&cPath=7"><span class="a-btn-slide-text">More</span></a>

19 Oct 2017, 11:22 AM
#2174
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Sorry I made a mistake for the product, but for the category I get it

<href="https://mozit:8890/index.php?main_page=index&cPath=">

19 Oct 2017, 11:43 AM
#2175
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

diamond1:

Sorry I made a mistake for the product, but for the category I get it

<href="https://mozit:8890/index.php?main_page=index&cPath=">

$productlink = zen_href_link(zen_get_info_page($products_id),  'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id))  . '&products_id=' . $products_id));
    $cPath_new = 'cPath=' . [b]( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id))[/b];
    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new); 

Or:

$productlink = zen_href_link(zen_get_info_page($products_id),  'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id))  . '&products_id=' . $products_id));
    $cPath_new = 'cPath=' . [b]$cPath[/b];
    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new); 
19 Oct 2017, 12:01 PM
#2176
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

No, the first white page code, the second does not change anything forever
<href="https://mozit:8890/index.php?main_page=index&cPath=">

19 Oct 2017, 12:13 PM
#2177
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

diamond1:

No, the first white page code, the second does not change anything forever
<href="https://mozit:8890/index.php?main_page=index&cPath=">

In this:

$productlink = zen_href_link(zen_get_info_page($products_id),  'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id))  . '&products_id=' . $products_id));
    $cPath_new = 'cPath=' . [B]([/B] ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id));
    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new); 

Remove the extra parentheses (highlighted above):

$productlink = zen_href_link(zen_get_info_page($products_id),  'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id))  . '&products_id=' . $products_id));
    $cPath_new = 'cPath=' . ($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])  > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) :  $_GET['cPath'] > 0 ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev(zen_get_products_category_id($products_id));
    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new); 

Thought that before, the use of $cPath provided a result? Ohh, sorry: it was $cpath instead as shown here:

diamond1:

I have another problem, I have a slide in the home that takes the product id from the db, if I read the source code I notice that the link of the category or the product link is not generated by ceon uri I products = id etc. clicking does a normal thing, but SEOs have links on the page with rederict 301 is not the best. How can I do to generate the correct links without cpath etc.

$productlink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=product_info&cPath='.$cpath.'&products_id='.$products_id;
$showmorelink=HTTP_SERVER . DIR_WS_CATALOG.'index.php?main_page=index&cPath='.$cpath;

<a href="<?php echo $productlink; ?>"><span class="a-btn-text">Buy now</span></a>
<a href="<?php echo $showmorelink; ?>"><span class="a-btn-slide-text">More</span></a>


So the second "form" could be:

$productlink = zen_href_link(zen_get_info_page($products_id), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $GET['cPath'] > 0 ? zen_get_generated_category_path_rev($GET['cPath']) : zen_get_generated_category_path_rev(zen_get_products_category_id($products_id)) . '&products_id=' . $products_id));
$cPath_new = 'cPath=' . [B]$cpath[/B];
// strip out 0
from top level cats
$cPath_new = str_replace('=0
', '=', $cPath_new);
$showmorelink = zen_href_link(FILENAME_DEFAULT, $cPath_new);

19 Oct 2017, 12:21 PM
#2178
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

now it works perfectly with the second, you've been very kind thanks thanks

23 Oct 2017, 3:19 PM
#2179
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi,

I was about to install CEON URI into a zc155e and came here to confirm there were no conflicts. I read thru the conversation about breadcrumb issues and would prefer to avoid them.

I have two questions. First, both Torvista and MC supply github links... which should I use?

Second, Torvista's version is updated for php7 but I'm still running v5.5.38. Am I out of luck or is the php 7 version backwards compatible?

23 Oct 2017, 3:30 PM
#2180
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

Feznizzle:

Hi,

I was about to install CEON URI into a zc155e and came here to confirm there were no conflicts. I read thru the conversation about breadcrumb issues and would prefer to avoid them.

I have two questions. First, both Torvista and MC supply github links... which should I use?

Second, Torvista's version is updated for php7 but I'm still running v5.5.38. Am I out of luck or is the php 7 version backwards compatible?
I would suggest torvista's version for now as I created one just to push a change and to carry a conversation.

As for changes to support php 7, changes that have generally been made/needed to support php 7 are conditions that have existed for php 5.x but had not been implemented because they weren't required then. So, you should generally be okay with php 5.5.x and software that supports php 7.

I haven't looked yet, but torvista indicated that he carried over the change we discussed about breadcrumbs. I took his word for it in his previous post indicating that he updated the repo.