Show Posts

Messages - CalSci

Pages: [1]
Shipping Modules / Re: USPS Girth Calculation
« on: May 03, 2019, 12:27:15 AM »
Yes, that is correct, USPS has limitations on length+girth. Girth = 2*width+2*height, assuming that length is the longest side. Girth+length = length+2*width+2*height. Girth itself does not include length in it.

Shipping Modules / USPS Girth Calculation
« on: May 02, 2019, 06:35:09 AM »
In the file:
cart slash extensions slash default_usps slash storefront slash model slash extension slash default_usps.php

The following line is incorrect:

         // Calculate girth based on usps calculation
         $xml .= '      <Girth>' . (round(((float)$this->config->get('default_usps_length') + (float)$this->config->get('default_usps_width') * 2 + (float)$this->config->get('default_usps_height') * 2), 1)) . '</Girth>';

Girth is 2*width+2*height. USPS does use length+girth often, but that is not the same thing. Also that formula only works if length is longer than width and height, otherwise it needs to sort the longest side out of the formula.

General Support / Re: Trying to print payment method on invoice
« on: May 02, 2019, 01:04:34 AM »
I've figured it out. You have to go to

cart slash admin slash controller slash response slash sale slash invoice.php

$this->data['orders'][] = array(
Look for the line:
'total' => $total_data

After the last line in orders add a comma and pament_method_key so it looks like this:
'total' => $total_data,
'payment_method' => $order_info['payment_method_key']

That will add the appropriate data to the orders variable before it gets passed to the invoice.

After that go to edit
cart slash admin slash view slash default slash template slash responses slash sale slash order_invoice.tpl

and add the line:
<?php echo $order['payment_method']; ?>
Where you want the payment method.

Apologies for the awkward formatting; this is a new account so I can't post links or code.

That fixed it, thank you.

I cannot directly share a link, because the forums don't let new accounts do that. Below is a test page which has buttons on it.

calsci dot com slash motorcycleinfo slash test dot html

You can see the annoying quotation marks on that page.

I have just installed AbanteCart on my already existing website as a back-end solution, replacing my old cart software. I have nearly everything the way I want it except two things. One of them is the [Qty:] and [Add to Cart] buttons have quotes in them, so they appear on the page as ["Qty:"] ["Add to Cart"]. After poking through the code for a few hours I figured out this annoying misuse of quotes is not a mistake but an artifact of the way that the variables are pulled from an XML file and then through several other subroutines. I've found that this exact same problem was in several other places in the same file, and in those places you used a function to strip the quotes out of the string, just not these. However the problem exists in a core file, which warns if edited will be overwritten when you update the cart to a new version, so I can't just fix it myself simply.

I would post exactly which files have the problem, and exactly where in the code the problem comes from so that you could fix this in 5 minutes, except that your forums have this rule that new accounts can't post URLs or code until we have sufficient karma. I could go make another thread and post some tips I've figured on how to customize AbanteCart to earn karma... but I can't do that because I can't post URLs or code. Who makes a forum to discuss software and bans new people from posting URLs and code??

The main piece of code is in the file js_product in the embed folder in the template folder in the default folder in the view folder in the store front folder.

The code in question echos the button text into some html which will be inserted into the page.

It pulls that text from the previous file, js, which is in the embed folder in the responses folder in the controller folder in the storefront folder.

That code sets the text to be the add to cart text which is gotten from the language storage of those variables. Elsewhere in that file there are subroutines which decode the string and strip out quotes. If you copied that code and applied it to this text before passing it on, the problem would be solved.

I would appreciate if you could take a few minutes to strip those quotes out for us. It makes our website look like it was written by idiots who don't know how to use quotes, when it's actually just a parsing error.

Pages: [1]

Powered by SMFPacks Social Login Mod