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

Ceon URI Mapping v4.x

Views: 451,994

Results 1,901 to 1,920 of 2,454
6 Jul 2015, 7:12 PM
#1901
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Ceon URI Mapping v4.x

lruskauff:

Hi DivaVocals
I'm sorry if I said too much. I tried to be vague. Maybe the moderators could remove my statement.
Linda

No worries, it's just that you seem to have more questions, and we're already pushing boundaries here.. :smile:

11 Jul 2015, 9:48 PM
#1902
andy_c27 avatar

andy_c27

Zen Follower

Join Date:
Oct 2010
Location:
United Kingdom
Posts:
477
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Andy-C27:

Can anyone help with cleaning up things like contact us, account and checkout stages (FEC installed) as they are all dirty url's and can't seem to clean them up .. I've been though a few pages , as I'm sure with 188 the answer is there
Am I able to do this with this module or do I need this other 1

12 Jul 2015, 11:15 PM
#1903
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ceon URI Mapping v4.x

Andy-C27:

Am I able to do this with this module or do I need this other 1

YES.. it's covered in the readme how to MANUALLY do this.. and in this support thread as well (which also references the readme..) If you want to do this AUTOMATICALLY you need the commercial module..

16 Jul 2015, 5:20 PM
#1904
andy_c27 avatar

andy_c27

Zen Follower

Join Date:
Oct 2010
Location:
United Kingdom
Posts:
477
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I just asked as the reviews don't work under "Auto-managed Product Page URIs" I don't use tell a friend but the others are ticked and have Reviews written in the boxes but I am still ending up with /index.php?main_page=reviews in the address bar

17 Jul 2015, 2:05 AM
#1905
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

Andy-C27:

I just asked as the **reviews don't work under "Auto-managed Product Page URIs" **I don't use tell a friend but the others are ticked and have Reviews written in the boxes but I am still ending up with /index.php?main_page=reviews in the address bar

That uri is one of those that is referenced in the instructions to be manually entered via install sql patches or through phpmyadmin and does not directly relate to any ticked option of auto-generating/managing URIs... The assignment instruction can be found in the _docs of the plugin, Configuration section, basically step 10...

As to the above in bold, please provide more than "doesn't work".. What doesn't work? What is happening, what is thought expected to need to happen? Tell a friend was disabled/removed from ZC in I think it was ZC 1.5.1 maybe as early as 1.5.0 (Sorry 3+ years ago), so is no longer really applicable to more current versions of ZC...

18 Jul 2015, 9:20 PM
#1906
andy_c27 avatar

andy_c27

Zen Follower

Join Date:
Oct 2010
Location:
United Kingdom
Posts:
477
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi...I mean url don't work as in getting /index.php?main_page=reviews not website.co.uk/reviews .. I was under the impression that if you ticked it ceon would sort it out ,but you have explained it doesn't .. I have been looking at the instructions and I am not exactly sure of what to do

18 Jul 2015, 11:42 PM
#1907
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

Andy-C27:

Hi...I mean url don't work as in getting /index.php?main_page=reviews not website.co.uk/reviews .. I was under the impression that if you ticked it ceon would sort it out ,but you have explained it doesn't .. I have been looking at the instructions and I am not exactly sure of what to do

But the URI for a product's review is being created correctly, yes?
That is the difference, the tick mark is for the generation of friendly URIs for reviews (of products), not that the main_page=reviews would get modified...

So, what part of the following is not understood. From there assistance can be offered.

10. Specifying the current URI Mapping for any other Zen Cart page

	 		There are two ways to specify static URIs for a Zen Cart page.  		 		
  1. The first is the most useful as it results in all links on the site to that page using the static URI instead of the standard dynamic Zen Cart URI (just as with products etc. using URI mappings).
  		**Please Note:** Any query string parameters are still appended to the URI.

  		Basically, this first method can be used to replace the likes of:

  		index.php?main_page=products_all&disp_order=3

  		with:

  		/our-products?disp_order=3.
  • Use software such as PHPMyAdmin to add a new record to the ceon_uri_mapping table.
  • The URI mapping to be mapped from should be entered in the uri field. (Remember to begin the URI with a slash ‘/’).
  • The number representing the language ID this URI mapping applies for should be entered in the language_id field.
  • The current_uri field should be set to “1” to make this the “current” URI.
  • The Zen Cart page to be mapped to should be entered in the main_page field.
  • The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function).
  • The query_string_parameters, associated_db_id and alternate_uri fields are not used, they must be left as “NULL”. The redirection_type_code is not used either so it doesn't matter what value it has (it can just be left at the default value of 301).
  1. The second is designed to allow data to be supplied to Zen Cart, by initialising the GET variables for the Zen Cart page when it is loaded.
  		 					**Please Note:** Since the second method matches against the **exact** query string parameters entered, when generating links on the site, the **query string parameters have to match exactly** or the URI entered won't be used as the link to the Zen Cart page entered, the standard Zen Cart dynamic URI will.
  			Any other parameters in the query string will cause this URI not  to be used as the static URI in links.. even sort parameters  (“disp_order=3”) will be enough to prevent the dynamic URI mapping to  the URI entered here.
  			For this reason it's recommended in most cases just to match  against the page's name using the first method, the second method really  is only for very specific circumstances when data needs to be loaded  for a page. For example:
  			When mapping a *uri* of ”/christmas-survey“ to a *main_page* of ”survey“ with *query_string_parameters* of “survey_id=12”.
  • Use software such as PHPMyAdmin to add a new record to the ceon_uri_mapping table.
  • The URI mapping to be mapped from should be entered in the uri field. (Remember to begin the URI with a slash ‘/’).
  • The number representing the language ID this URI mapping applies for should be entered in the language_id field.
  • The current_uri field should be set to “1” to make this the “current” URI.
  • The Zen Cart page to be mapped to should be entered in the main_page field.
  • If any GET variables should be set, simply enter them in the query_string_parameters field, separating each pair with an ampersand (‘&’), but not starting the string with a question mark or an ampersand.
  • For example, to map to a custom survey page, with the necessary survey_type and survey_id for the survey to be shown, the main_page field would be set to:
  • survey
  • and the query_string_parameters field would be set to:
  • survey_type=4&survey_id=23
  • The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function).
  • The associated_db_id and alternate_uri fields are not used, they must be left as “NULL”. The redirection_type_code is not used either so it doesn't matter what value it has (it can just be left at the default value of 301).
29 Jul 2015, 8:49 PM
#1908
traytray avatar

traytray

Totally Zenned

Join Date:
May 2012
Posts:
566
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I've just noticed that on products that are copied to one or more categories, the URL contains a cPath if I get to the page via one of the copied categories. I got to this page by going to the category 'Gift Sets' and then clicking on this product's image or description under the image.When I do that, I get this address:

http://www.designerperfumesnob.com/womens-perfume/Givenchy/Amarige/Gift-Set?cPath=1348&

However, if I were to access this same page from Search, or from the manufacturers list, it looks like this:

http://www.designerperfumesnob.com/womens-perfume/Givenchy/Amarige/Gift-Set

Can I not get the 'friendly' URL from a copied category?

29 Jul 2015, 9:14 PM
#1909
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

traytray:

I've just noticed that on products that are copied to one or more categories, the URL contains a cPath if I get to the page via one of the copied categories. I got to this page by going to the category 'Gift Sets' and then clicking on this product's image or description under the image.When I do that, I get this address:

http://www.designerperfumesnob.com/womens-perfume/Givenchy/Amarige/Gift-Set?cPath=1348&

However, if I were to access this same page from Search, or from the manufacturers list, it looks like this:

http://www.designerperfumesnob.com/womens-perfume/Givenchy/Amarige/Gift-Set

Can I not get the 'friendly' URL from a copied category?

The first URI is one to a linked product. (Master_categories_d not the same as the current category) ths "result" is identified in the plugin documentation. The additional information supports identfying to which category to show for that chosen product.

30 Jul 2015, 2:06 PM
#1910
anglerscorner avatar

anglerscorner

New Zenner

Join Date:
Jan 2015
Location:
United Kingdom
Posts:
30
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hello,

I have installed this module and while everything seems to work fine I have seen a couple of errors in my logs as follows:

PHP Fatal error: Call to a member function add() on a non-object in /home/anglersc/public_html/includes/classes/class.CeonURIMappingHandlerBase.php on line 131

and

PHP Fatal error: 1267:Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' :: SELECT uri FROM zen_ceon_uri_mappings WHERE main_page = 'account_history_infoℴ_id=577' AND associated_db_id IS NULL AND query_string_parameters IS NULL AND language_id = '1' AND current_uri = '1' LIMIT 1; ==> (as called by) /home/anglersc/public_html/includes/classes/class.CeonURIMappingDBLookup.php on line 166 <== in /home/anglersc/public_html/includes/classes/db/mysql/query_factory.php on line 155

The module appears to work fine and do what is expected of it but these errors had me worried so I have deactivated it for now. I'm not really clued up on PHP sadly so I was just wondering if these errors are harmless or not, can I ignore them? ...if not is there an easy way to sort it or should I just forget about ever using this module?

Thanks in advance :)

30 Jul 2015, 3:54 PM
#1911
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

AnglersCorner:

Hello,

I have installed this module and while everything seems to work fine I have seen a couple of errors in my logs as follows:

PHP Fatal error: Call to a member function add() on a non-object in /home/anglersc/public_html/includes/classes/class.CeonURIMappingHandlerBase.php on line 131

and

PHP Fatal error: 1267:Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' :: SELECT uri FROM zen_ceon_uri_mappings WHERE main_page = 'account_history_infoℴ_id=577' AND associated_db_id IS NULL AND query_string_parameters IS NULL AND language_id = '1' AND current_uri = '1' LIMIT 1; ==> (as called by) /home/anglersc/public_html/includes/classes/class.CeonURIMappingDBLookup.php on line 166 <== in /home/anglersc/public_html/includes/classes/db/mysql/query_factory.php on line 155

The module appears to work fine and do what is expected of it but these errors had me worried so I have deactivated it for now. I'm not really clued up on PHP sadly so I was just wondering if these errors are harmless or not, can I ignore them? ...if not is there an easy way to sort it or should I just forget about ever using this module?

Thanks in advance :)

Couple of things going on here. For one it looks like your database is not using UTF-8 collation, would suggest following the instructions of the Convert db2utf8 plugin that converts the database to UTF-8, there are also some files through the system that would need changing to recognize/handle the db as UTF8/UTF-8, etc... The next thing is that the rewrite that is being attempted there has scrambled some of the information pushing &order_id into: ℴ_id as part of the main_page. Such a parameter should not be in the main_page but instead in the query_string_parameters field. The first error may be some sort of result of the second, but the error message generated (which btw is generated before the $messageStack has been initialized to actually present that error) indicates that there is server information missing to be able to support mapping URIs. If that issue is not generated each and every time the site is visited, then there may be something intermittent with your host's server(s) and would suggest inquiring to them why the REQUEST_URI server variable is not present or wasn't present at the time of the error. (Provide them log times of that first error.)

Perhaps there is other assistance also suggested, but that is what I see of what has been reported. Assuming that the database conversion and file modifications to support goes successfully, then the only other issue is to address whatever host problem(s) are generated. Perhaps it would help the community if you were to identify with whom you host your site?

30 Jul 2015, 9:59 PM
#1912
chervickers avatar

chervickers

New Zenner

Join Date:
Oct 2010
Location:
Indiana
Posts:
72
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

SHIP STATION ISSUE.

Here is what the developer of Shipstation sent back to me:

I tried to reach you but was only able to leave a voicemail. It appears that you have figured this out. Currently the ZenCart 3rd Party ShipStation Connection and CEON are not compatible. Like you said its one or the other. I wish I had another option for you but because we did not build that integration we do not have control over it.

So, my question is..
is there a fix we can use in the CEON code to make this work?

Please advise!
Thanks!
Cherie

30 Jul 2015, 10:51 PM
#1913
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

CherVickers:

SHIP STATION ISSUE.

Here is what the developer of Shipstation sent back to me:

I tried to reach you but was only able to leave a voicemail. It appears that you have figured this out. Currently the ZenCart 3rd Party ShipStation Connection and CEON are not compatible. Like you said its one or the other. I wish I had another option for you but because we did not build that integration we do not have control over it.

So, my question is..
is there a fix we can use in the CEON code to make this work?

Please advise!
Thanks!
Cherie

I haven't looked at the shipstation code, but it seems that 1) it is not totally integrated with ZC, but 2) that if the issue is that it doesn't know how to process the resulting URI, then ether the uri needs to be decoded using applicable functions or an alternate zen_href_link function that doesn't return the rewritten uri might be applicable. Again this is just a guess at what the issue with shipstation is in relation to the rewritten uri.

31 Jul 2015, 4:44 PM
#1914
chervickers avatar

chervickers

New Zenner

Join Date:
Oct 2010
Location:
Indiana
Posts:
72
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Here is the code I used to add shipstation:

added in this .php file to site: shipstation_zc.php

and I added this code to my .htaccess file:

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] </IfModule>

here is the detail from the .php file:

<?php /* * ShipStation Shipping Module for Zen Cart, Version 1.5 * * Copyright (c) 2011 Auctane LLC * * Find out more about ShipStation at <https://www.shipstation.com> * * Released under the GNU General Public License v2 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; under version 2 of the License * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ ?> <?php require('includes/application_top.php'); //set the content type to xml header('Content-Type: text/xml'); /** * function to add noode to the xml * * @para $FieldName string * @para $Value string * @retrurn xml */ function AddFieldToXML($FieldName, $Value) { $FindStr = "&"; $NewStr = "&"; $Result = str_replace($FindStr, $NewStr, $Value); echo "\t\t<$FieldName>$Result</$FieldName>\n"; } /** * function to authenticate username and password sent from the shipstation * * @para $db object * @retrurn boolean */ function userAuthentication($db = null) { $un = $_GET['SS-UserName']; $pw = $_GET['SS-Password']; if (!isset($un) || strlen($un) == 0) { header('WWW-Authenticate: Basic realm="ShipStation"'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { $admin_query = "SELECT admin_id, admin_pass FROM " . TABLE_ADMIN . " WHERE admin_name = '" . $un . "'"; $admin_result = $db->Execute($admin_query); //validate the password with the zencart encrypted password if (!zen_validate_password($pw, $admin_result->fields['admin_pass'])) { header('WWW-Authenticate: Basic realm="ShipStation"'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } } } /** * function to convert the start and end date with zend date format * * @para $date date * @para $reverse boolean * @retrurn date */ function zen_date_raw2($date, $reverse = false) { if ($reverse) { return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4); } else { return substr($date, 6, 4) . '-' . substr($date, 0, 2) . '-' . substr($date, 3, 2) . ' ' . substr($date, 11, 2) . '.' . substr($date, 14, 2) . '.' . '00'; } } /** * function to convert the ordr end date with date time format * * @para $raw_datetime date * @retrurn date */ function zen_datetime_short2($raw_datetime) { if (($raw_datetime == '0001-01-01 00:00:00') || ($raw_datetime == '')) return false; $year = (int) substr($raw_datetime, 0, 4); $month = (int) substr($raw_datetime, 5, 2); $day = (int) substr($raw_datetime, 8, 2); $hour = (int) substr($raw_datetime, 11, 2); $minute = (int) substr($raw_datetime, 14, 2); $second = (int) substr($raw_datetime, 17, 2); return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year)); } // SSZen.php?action=export&start_date=06/02/2009%2005:30&end_date=11/05/2009%2022:53 if ($_GET['action'] == 'export') { //call the user authentication before start of order data replication userAuthentication($db); $sd = zen_date_raw2((!isset($_GET['start_date']) ? date("m-d-Y", (time())) : $_GET['start_date'])); $ed = zen_date_raw2((!isset($_GET['end_date']) ? date("m-d-Y", (time())) : $_GET['end_date'])); //get order from database $orders_query = "SELECT * FROM " . TABLE_ORDERS . " WHERE orders_id >'0' and IFNULL(last_modified, date_purchased) BETWEEN '" . $sd . "' AND DATE_ADD('" . $ed . "', INTERVAL 1 MINUTE)"; $orders_result = $db->Execute($orders_query); if ($orders_result->fields['orders_id']) { //begin outputing XML echo "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n";
    echo "<Orders>\n";
    //process orders
    while (!$orders_result->EOF) {
        //get order items from datbase
        $orderitems_query = "SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id = '" . $orders_result->fields['orders_id'] . "'";
        $orderitems_result = $db->Execute($orderitems_query);

        $cust_id = $orders_result->fields['customers_id'];
        $cust_deff_id = $orders_result->fields['customers_default_address_id'];
        $address_query = "SELECT * FROM " . TABLE_ADDRESS_BOOK . " WHERE customers_id = '$cust_id' and address_book_id = '$cust_deff_id'";
        $address_result = $db->Execute($address_query);

        //billing country code
        $billing_country_id = $orders_result->fields['billing_country'];
        $billing_query = "SELECT * FROM " . TABLE_COUNTRIES . " WHERE countries_name = '$billing_country_id'";
        $billing_result = $db->Execute($billing_query);
        //billing country code
        //shipping country code
        $shipping_country_id = $orders_result->fields['delivery_country'];
        $shipping_query = "SELECT * FROM " . TABLE_COUNTRIES . " WHERE countries_name = '$shipping_country_id'";
        $shipping_result = $db->Execute($shipping_query);
        //billing zone code
        $billing_zone_id = addslashes($orders_result->fields['billing_state']);
        $zone_billing_query = "SELECT * FROM " . TABLE_ZONES . " WHERE zone_name = '$billing_zone_id'";
        $zone_billing_result = $db->Execute($zone_billing_query);
        //billing zone code
        //shipping zone code
        $shipping_zone_id = addslashes($orders_result->fields['delivery_state']);
        $zone_shipping_query = "SELECT * FROM " . TABLE_ZONES . " WHERE zone_name = '$shipping_zone_id'";
        $zone_shipping_result = $db->Execute($zone_shipping_query);
        //shipping zone code

        $ship_order_id = $orders_result->fields['orders_id'];
        $ship_query = "SELECT * FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '$ship_order_id' and class = 'ot_shipping'";
        $ship_result = $db->Execute($ship_query);

        $orders_status = $db->Execute("select orders_status_id, orders_status_name
                                 from " . TABLE_ORDERS_STATUS . "
                                 where language_id = '" . (int) $_SESSION['languages_id'] . "' and orders_status_id = '" . $orders_result->fields['orders_status'] . "'");

        if ($orders_status->fields['orders_status_name']) {
            $order_status = $orders_status->fields['orders_status_name'];
            $order_status_id = $orders_status->fields['orders_status_id'];
        } else {
            $order_status = '';
            $order_status_id = '';
        }

        if ($order_status_id) {
            $orders_history = $db->Execute("select date_added
                                    from " . TABLE_ORDERS_STATUS_HISTORY . "
                                    where orders_id = '" . zen_db_input($orders_result->fields['orders_id']) . "' and orders_status_id = '" . $order_status_id . "'
                                    order by date_added LIMIT 1");

            $last_modified = zen_datetime_short2($orders_history->fields['date_added']);

            $orders_history_comments = $db->Execute("select comments
                                      from " . TABLE_ORDERS_STATUS_HISTORY . "
                                      where orders_id = '" . zen_db_input($orders_result->fields['orders_id']) . "' and (comments is not null or comments != '')
                                    order by date_added LIMIT 1");

            $shipping_comments = $orders_history_comments->fields['comments'];
        } else {
            $last_modified = '';
            $shipping_comments = '';
        }

        echo "\t<Order>\n";

        //order details
        AddFieldToXML("OrderNumber", $orders_result->fields['orders_id']);
        AddFieldToXML("OrderDate", zen_datetime_short2($orders_result->fields['date_purchased']));
        AddFieldToXML("OrderStatusCode", $order_status_id);
        AddFieldToXML("OrderStatusName", $order_status);
        AddFieldToXML("LastModified", $last_modified);
        AddFieldToXML("LastModifiedOrderTable", $orders_result->fields['last_modified']);
        AddFieldToXML("date_purchased", $orders_result->fields['date_purchased']);
        AddFieldToXML("PaymentMethod", '<![CDATA[' . $orders_result->fields['payment_method'] . ']]>');
        AddFieldToXML("PaymentMethodCode", $orders_result->fields['payment_module_code']);
        AddFieldToXML("ShippingMethod", '<![CDATA[' . $orders_result->fields['shipping_method'] . ']]>');
        //AddFieldToXML("ShippingMethodCode", $orders_result->fields['shipping_module_code']);
        AddFieldToXML("ShippingMethodCode", '<![CDATA[' . $orders_result->fields['shipping_method'] . ']]>');
        AddFieldToXML("CouponCode", $orders_result->fields['coupon_code']);
        AddFieldToXML("Currency", $orders_result->fields['currency']);
        AddFieldToXML("CurrencyValue", $orders_result->fields['currency_value']);
        AddFieldToXML("OrderTotal", $orders_result->fields['order_total']);
        AddFieldToXML("TaxAmount", $orders_result->fields['order_tax']);
        AddFieldToXML("ShippingAmount", $ship_result->fields['value']);
        AddFieldToXML("CommentsFromBuyer", '<![CDATA[' . $shipping_comments . ']]>');
        //order details
        //customer details
        echo "\t<Customer>\n";

        AddFieldToXML("CustomerNumber", $orders_result->fields['customers_id']);

        //billing details
        echo "\t<BillTo>\n";

        $billing_state = $orders_result->fields['billing_state'];

        AddFieldToXML("Name", '<![CDATA[' . $orders_result->fields['billing_name'] . ']]>');
        AddFieldToXML("Company", '<![CDATA[' . $orders_result->fields['billing_company'] . ']]>');
        AddFieldToXML("Address1", '<![CDATA[' . $orders_result->fields['billing_street_address'] . ']]>');
        AddFieldToXML("Address2", '<![CDATA[' . $orders_result->fields['billing_suburb'] . ']]>');
        AddFieldToXML("City", '<![CDATA[' . $orders_result->fields['billing_city'] . ']]>');
        AddFieldToXML("State", '<![CDATA[' . $billing_state . ']]>');
        AddFieldToXML("StateCode", $zone_billing_result->fields['zone_code']);
        AddFieldToXML("PostalCode", $orders_result->fields['billing_postcode']);
        AddFieldToXML("Country", $orders_result->fields['billing_country']);
        AddFieldToXML("CountryCode", $billing_result->fields['countries_iso_code_2']);
        AddFieldToXML("Phone", $orders_result->fields['customers_telephone']);
        AddFieldToXML("Email", $orders_result->fields['customers_email_address']);
        //	AddFieldToXML("CountryCode", $country_result->fields['countries_iso_code_2']);

        echo "\t</BillTo>\n";
        //billing details
        //shipping details

        echo "\t<ShipTo>\n";

        $shipping_state = $orders_result->fields['delivery_state'];

        AddFieldToXML("Name", '<![CDATA[' . $orders_result->fields['delivery_name'] . ']]>');
        AddFieldToXML("Company", '<![CDATA[' . $orders_result->fields['delivery_company'] . ']]>');
        AddFieldToXML("Address1", '<![CDATA[' . $orders_result->fields['delivery_street_address'] . ']]>');
        AddFieldToXML("Address2", '<![CDATA[' . $orders_result->fields['delivery_suburb'] . ']]>');
        AddFieldToXML("City", '<![CDATA[' . $orders_result->fields['delivery_city'] . ']]>');
        AddFieldToXML("State", '<![CDATA[' . $shipping_state . ']]>');
        AddFieldToXML("StateCode", $zone_shipping_result->fields['zone_code']);
        AddFieldToXML("PostalCode", $orders_result->fields['delivery_postcode']);
        AddFieldToXML("Country", $orders_result->fields['delivery_country']);
        AddFieldToXML("CountryCode", $shipping_result->fields['countries_iso_code_2']);

        echo "\t</ShipTo>\n";
        //shipping details

        echo "\t</Customer>\n";
        //customer details
        echo "\t<Items>\n";
        //process Order Items
        while (!$orderitems_result->EOF) {

            $image_query = "SELECT products_image, products_weight FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $orderitems_result->fields['products_id'] . "'";
            $image_result = $db->Execute($image_query);

            echo "\t<Item>\n";
            AddFieldToXML("ProductID", $orderitems_result->fields['products_id']);
            AddFieldToXML("SKU", '<![CDATA[' . $orderitems_result->fields['products_model'] . ']]>');
            AddFieldToXML("Name", '<![CDATA[' . $orderitems_result->fields['products_name'] . ']]>');
            AddFieldToXML("ImageUrl", HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $image_result->fields['products_image']);
            AddFieldToXML("Weight", $image_result->fields['products_weight']);
            AddFieldToXML("UnitPrice", round($orderitems_result->fields['final_price'], 2));
            AddFieldToXML("TaxAmount", round($orderitems_result->fields['products_tax'], 2));
            AddFieldToXML("Quantity", $orderitems_result->fields['products_quantity']);

            $orderitems_attributes_query = "SELECT orders_products_attributes_id, products_options, products_options_values  FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " WHERE orders_id = '" . $orders_result->fields['orders_id'] . "' and orders_products_id = '" . $orderitems_result->fields['orders_products_id'] . "'";
            $orderitems_attributes_result = $db->Execute($orderitems_attributes_query);

            if ($orderitems_attributes_result->fields['orders_products_attributes_id']) {
                echo "\t<Options>\n";
            }

            while (!$orderitems_attributes_result->EOF) {

                echo "\t<Option><Name><![CDATA[" . $orderitems_attributes_result->fields['products_options'] . "]]></Name><Value><![CDATA[" . $orderitems_attributes_result->fields['products_options_values'] . "]]></Value></Option>\n";

                $orderitems_attributes_result->MoveNext();
            }

            if ($orderitems_attributes_result->fields['orders_products_attributes_id']) {
                echo "\t</Options>\n";
            }

            echo "\t</Item>\n";

            $orderitems_result->MoveNext();
        }
        //process Order Items
        echo "\t</Items>\n";
        echo "\t</Order>\n";

        $orders_result->MoveNext();
    }

    //process Orders
    //finish outputing XML
    echo "</Orders>";
} else {

    echo "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n";
    echo "<Orders />\n";
}

} elseif ($_GET['action'] == 'verifystatus') {
echo 'true';
} elseif ($_GET['action'] == 'update') {

//?action=update&order_number=ABC123&status=4&comment=commment
userAuthentication($db);
if ($_GET['order_number']) {

    $status = strtolower($_GET['status']);
    $customer_notified = '0';
    $comments = $_GET['comment'];


    $record_query = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE orders_id = '" . $_GET['order_number'] . "'";
    $record_result = $db->Execute($record_query);

    if ($record_result->fields['orders_id']) {

        $orders_status = $db->Execute("select orders_status_id, orders_status_name
                                 from " . TABLE_ORDERS_STATUS . "
                                 where language_id = '" . (int) $_SESSION['languages_id'] . "' and LOWER(orders_status_name) = '" . $status . "'");

        if ($orders_status->fields['orders_status_id']) {

            $status = $orders_status->fields['orders_status_id'];

            $db->Execute("update " . TABLE_ORDERS . "
                        set orders_status = '" . zen_db_input($status) . "', last_modified = now()
                        where orders_id = '" . (int) $_GET['order_number'] . "'");

            $db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                      (orders_id, orders_status_id, date_added, customer_notified, comments)
                      values ('" . (int) $_GET['order_number'] . "',
                      '" . zen_db_input($status) . "',
                      now(),
                      '" . zen_db_input($customer_notified) . "',
                      '" . zen_db_input($comments) . "')");
            echo 'Status updated successfully';
        } else {
            echo 'No order status in database';
        }
    } else {
        echo 'Order does not exist in database';
    }
} else {
    echo 'No order number';
}

} else {
echo 'No action parameter. Please contact software provider.';
}
?>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
31 Jul 2015, 4:45 PM
#1915
chervickers avatar

chervickers

New Zenner

Join Date:
Oct 2010
Location:
Indiana
Posts:
72
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

I haven't looked at the shipstation code, but it seems that 1) it is not totally integrated with ZC, but 2) that if the issue is that it doesn't know how to process the resulting URI, then ether the uri needs to be decoded using applicable functions or an alternate zen_href_link function that doesn't return the rewritten uri might be applicable. Again this is just a guess at what the issue with shipstation is in relation to the rewritten uri.

Please see the last post I made with the added code. Is there a place in CEON where I can override the above as you suggest?
I am not a developer, so any specifics would be helpful!
thanks!
c

31 Jul 2015, 5:54 PM
#1916
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Ceon URI Mapping v4.x

CherVickers:

Please see the last post I made with the added code. Is there a place in CEON where I can override the above as you suggest?
I am not a developer, so any specifics would be helpful!
thanks!
c

See/saw it, but in the future, please enclose the code within code tags '[' CODE ']' (remove the spaces and single apostrophes. I still haven't figured out how to type that in this editor so that it will remain intact, but maybe one day. :) ) This can be automated by clicking the # symbol in the toolbar above the message box and then pasting the code...

A few things I see so far:

One, where is the addition of the .htaccess code in relation to the CEON .htaccess code?
Two, a filename "shipstation_zc.php" was provided and the added rewrite directs to app.php, then there is "the code of the .php". How do these three pieces fit together?
Three, this method of access is rife with potential security issues... transferring username and password in a GET statement??? Wow... No validation on the GET data sent? Another Wow...
Four, what is actually called to "activate" shipstation? Is there some sort of specific filename called, or is it "always active"?
Five, can we take this to a new thread as it looks like the discussion may be lengthy. Suggest starting a new thread perhaps in the general section, returning here to post the link for those interested, continue the discussion there (including answering the above questions), then we can post a solution here for those interested in the end result... Just an idea that perhaps others may appreciate as well. :) To me it looks like initial integration of the program with ZC is the issue (.htaccess rule), but need to work through that to provide a suitable method of having both because so far I don't see any issue with "the code of the .php" per se.

31 Jul 2015, 6:01 PM
#1917
chervickers avatar

chervickers

New Zenner

Join Date:
Oct 2010
Location:
Indiana
Posts:
72
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

See/saw it, but in the future, please enclose the code within code tags '[' CODE ']' (remove the spaces and single apostrophes. I still haven't figured out how to type that in this editor so that it will remain intact, but maybe one day. :) ) This can be automated by clicking the # symbol in the toolbar above the message box and then pasting the code...

A few things I see so far:

One, where is the addition of the .htaccess code in relation to the CEON .htaccess code?
Two, a filename "shipstation_zc.php" was provided and the added rewrite directs to app.php, then there is "the code of the .php". How do these three pieces fit together?
Three, this method of access is rife with potential security issues... transferring username and password in a GET statement??? Wow... No validation on the GET data sent? Another Wow...
Four, what is actually called to "activate" shipstation? Is there some sort of specific filename called, or is it "always active"?
Five, can we take this to a new thread as it looks like the discussion may be lengthy. Suggest starting a new thread perhaps in the general section, returning here to post the link for those interested, continue the discussion there (including answering the above questions), then we can post a solution here for those interested in the end result... Just an idea that perhaps others may appreciate as well. :) To me it looks like initial integration of the program with ZC is the issue (.htaccess rule), but need to work through that to provide a suitable method of having both because so far I don't see any issue with "the code of the .php" per se.

Yes, I've continued the discussion here:
https://www.zen-cart.com/showthread.php?217919-Shipstation-and-CEON-URL-failing-to-integrate-%28continued-discussion%29&p=1288674#post1288674

I will get with my developer to see how to best respond to your questions! THANK YOU!

25 Aug 2015, 11:40 PM
#1918
racingtech avatar

racingtech

New Zenner

Join Date:
Nov 2012
Location:
US
Posts:
61
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I'll save everyone some time and get to the point.

Just installed CEON and started with the generated rewrite code from the CEON install, while it does convert the url the page doesn't come up it just has an 404 error.

If I turn off Ceon the page works fine but no url rewrite.

I noticed in the url listed in the error that the root directory of the server is showing up twice with page not found. I have the htaccess in the root directory of the server and there isn't anything in the htaccess that I can see to where its being added so that I can remove it, maybe I have the htaccess in the wrong directory.

site is http://www.atvpartspro.com/ and there is only one product, handlebars.

Any help would be appreciated.

26 Aug 2015, 12:00 AM
#1919
racingtech avatar

racingtech

New Zenner

Join Date:
Nov 2012
Location:
US
Posts:
61
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

racingtech:

I'll save everyone some time and get to the point.

Just installed CEON and started with the generated rewrite code from the CEON install, while it does convert the url the page doesn't come up it just has an 404 error.

If I turn off Ceon the page works fine but no url rewrite.

I noticed in the url listed in the error that the root directory of the server is showing up twice with page not found. I have the htaccess in the root directory of the server and there isn't anything in the htaccess that I can see to where its being added so that I can remove it, maybe I have the htaccess in the wrong directory.

site is http://www.atvpartspro.com/ and there is only one product, handlebars.

Any help would be appreciated.

Never mind, moved the generated code to the server root and it works fine now. Sorry

30 Aug 2015, 2:49 PM
#1920
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

DivaVocals:

It does and I will undo the two changes I made that are not needed..

On another note.. I need to send you an an e-mail under separate cover with regards to questions I have regarding the mapping manager and "other" pages..

Hello,

I added a new product type, namely bookx, and modified the file includes/extra_datafiles/ceon_uri_mapping_product_pages.php as follows:
$ceon_uri_mapping_product_pages = array(
FILENAME_DOCUMENT_GENERAL_INFO,
FILENAME_DOCUMENT_PRODUCT_INFO,
FILENAME_PRODUCT_INFO,
FILENAME_PRODUCT_BOOK_INFO,
FILENAME_PRODUCT_FREE_SHIPPING_INFO,
FILENAME_PRODUCT_MUSIC_INFO,
FILENAME_PRODUCT_BOOKX_INFO
);
But it is not working.

The plugin works in every other respect.
My setup is zencart version 1.54, Ceon URI Mapping version 4.5.0

Please help