Accessing UPS Debug Script

  • Posts: 32
  • Thank you received: 1
9 years 2 weeks ago #220053

-- url of the page with the problem -- : www.nicaboyne.com
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4.44
-- Browser(s) name and version -- : Chrome OSX
-- Error-message(debug-mod must be tuned on) -- : N/A

Hi,

I've set my UPS shipping method to Debug. Looking in the UPS.php file in the plugin directory, I see that it's set to place the UPS rate query in HTML comments.

However, what's the page where this is rendered? I tried checking in the checkout page where you select the UPS method you want, but I don't see the query data in the source.

Am I looking in the wrong place?

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 2 weeks ago #220117

Hi,

Yes, the content will be put in the HTML data as comments.
But because HikaShop have a shipping cache system ; the shipping plugins are not called every time but only when the cart content changed (or some shipping method configuration changed).

So the best is to change your cart content or re-save a shipping configuration in your backend ; then to go in your checkout and use your browser inspected to see the page DOM content.

The other solution would be to modify the UPS plugin in order to perform a "writeToLog" instead of a display in the page.
But it would require to copy the function "writeToLog" from the HikaShop helper because that function is currently only available for payment methods.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
9 years 1 week ago #220607

I went into the UPS plugin and changed the UPS.php to have some more easily findable text like "<!-- UPS RATE" and it still isn't appearing.

I changed addresses, quantities, etc. and don't see the value showing up anywhere in the DOM. It's very confusing and frustrating.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 week ago #220636

Hi,

1 -

The other solution would be to modify the UPS plugin in order to perform a "writeToLog" instead of a display in the page.
But it would require to copy the function "writeToLog" from the HikaShop helper because that function is currently only available for payment methods.


2 - You can see to deactivate the shipping cache by modifying a variable in the shipping plugin class.
Replacing
var $use_cache = true;
By
var $use_cache = false;

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
9 years 1 week ago #220672

Thanks Jerome.

I've disabled caching for now but the main issue is I don't know where to look for this HTML comment. I've tried different browsers (Chrome, Safari, MS Edge) and none of them appear to show these comments. It's very frustrating. I must just be looking in the wrong place.

I'm not going to copy and paste PHP around because I'm concerned about messing up the UPS plugin or failing to call writeToLog correctly.

Each step is done with ajax calls, is that why I don't see it in the develop consoles? I'm just at a loss.

This is all in service of trying to fix my ORIGINAL issue,which is that rates are really out of whack compared to the exact same package quoted from UPS.com (only using weights, no package dimensions on either system.). I know, I know, you just hit UPS's webservice for rates but there's obviously something different about what HIkaShop is sending versus what I'm filling in via UPS.com's forms.

Last edit: 9 years 1 week ago by killnine.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 1 week ago #220682

Hello,
You'll find the debug trace during the shipping step of your checkout workflow through an HTML comment on the HTML code of your page.
The fact that you don't have any UPS comment on the HTML code of your page is probably coming from the fact that your shipping step is called with AJAX.
Temporarily changing these lines one the "ups.php" file of your plugin will probably do the job :

if(@$rate->shipping_params->debug){
	echo '<!-- '. $xml. ' -->'."\r\n"; // THIS LINE IS FOR DEBUG PURPOSES ONLY-IT WILL SHOW IN HTML COMMENTS
}
By :
var_dump($xml);
exit;
Don't forget to revert this change after you had the XML code sent to UPS.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum