Jump to content

Absolute prices generation


peterp

Recommended Posts

Hi All,

I may not have setup a product correctly to achieve my requirement. The requirement is that this product comes in with different options of size and color and some sizes are priced differently than others. So I set up the product with a unit price of $11.30 including 10% GST and for 3 special sizes I set the price to be $12.60 including 10% GST and ticked the absolute box for these 3 special sizes. Unfortunately the unit price on the order doesn't reflect the correct price for the 3 special sizes but is OK for the the other sizes. So have I missed something within the setup of these special sizes and I shouldn't or should be setting up. All items in the inventory have a standard tax of 10% and this will include any special prices will have a 10% tax as well.

Hope somebody can point me in the right direct to resolve this issue. I have attached a couple of screen shots that maybe helpful as to how I have setup the product.

Thanks for your help very much appreciated.

Best Regards,

Peterp

product price options.pdf champco order unit prices.pdf

Link to comment
Share on other sites

Could you please read these issues in the Github and determine if anything might apply?

Bad tax calculation with absolute option price and tax inc
https://github.com/cubecart/v6/issues/3301
Applied to CC652 (not yet released)

Product Options - Bugs with mixture of absolute / non absolute option value
https://github.com/cubecart/v6/issues/2566
Applied to CC640-b1

 

Link to comment
Share on other sites

Hi Brian,

I have tried the first fix and this fixed the problem of the tax calculation however when I tried the second fix I noticed that the line numbers were different, however I still applied the fixes. Now what seems to be happening is that when I go to the second secure checkout button press I get a blank screen, I'm not sure whether this changes have caused this or something else has happened.

If you could suggest something to get the site to display the order as it was would be great.

I have attached the error log if this is any help

Hope you can help

Best Regards,

Peterp

 

errorlog order display.pdf

Link to comment
Share on other sites

The 'errorlog order display" file shows only that a code snippet caused PHP to complain about a "token" that probably was not provided, which somehow triggered a need to log in to admin.

Please remind us the exact version of PHP and CubeCart this installation is running (regardless that your "tag line" says CC614).

 

Link to comment
Share on other sites

Hi Brian,

Thanks for your help I have attached a screen shot of the 'Store Overview' which shows version numbers for both the PHP and cubecart.

We are using a localhost at this stage as the site is under development and not ready for live implementation.

Hope this helps

Best Regards,

Peterp

cubecart and php version.pdf

Link to comment
Share on other sites

You said, "When I tried the second fix I noticed that the line numbers were different, however I still applied the fixes."

Note that the second mentioned issue in the Github (#2566) had already been applied in CC640.

Your screen grab above shows you are running CC651 - so that edit was not applicable. If those "fixes" you made are still in this installation, at the wrong line numbers, you will need to remove them.

 

Link to comment
Share on other sites

Hi Brian,

I reversed all of the modifications that were done and compared it to an unchanged cc651 just to satisfy me that all the changes were successful (and they were) unfortunately when I then tested the site and got to the final checkout selection all I got was a black screen again. I have attached a screen shot of the error log hoping this may help.

Hope this helps,

Best Regards,

Peterp

error log after reverse changes.pdf

Hi Brian,

I just went into the admin and tried to print the order and just got the blank screen again maybe this has something to do with this as well

Best Regards,

Peterp

Link to comment
Share on other sites

Something is throwing an "exception", and maybe CC651 is not getting it logged into the database.

Please make this edit in /classes/debug.class.php:

Near line 500, find:

    public function exceptionHandler($e)
    {
        $message = "[<strong>Exception</strong>] \t".$e->getFile().":".$e->getLine()." - ".$e->getMessage();
        $this->_errors[] = $message;
        $this->_writeErrorLog($message, 'Exception');
    }

Change to:

    public function exceptionHandler($e)
    {
        $message = "[<strong>Exception</strong>] \t".$e->getFile().":".$e->getLine()." - ".$e->getMessage(); trigger_error($message,E_USER_ERROR);
//      $this->_errors[] = $message;
//      $this->_writeErrorLog($message, 'Exception');
    }

Near line 480, find:

        $this->_errors[] = $error;

Change to:

        $error = (stristr($error_string, "[<strong>Exception</strong>]")) ?: $error; $this->_errors[] = $error;

When  you get the blank screen, maybe now there will be the reason for it in the System Error Log.

Also, one of the errors in the above post suggests that you do not have a complete /classes/PHPMailer/ folder.

Also, please consider using PHP 8.1 when running CC651.

Link to comment
Share on other sites

Hi Brian,

I have checked and the PHPMailer folder is not there so is it just a matter of copying the folder from a clean version of cubecart ver 651 or from a backup of this site or do I have to start from the beginning again. I would have thought the update would have copied this across.

Best Regards,

Peterp

Link to comment
Share on other sites

Hi Brian,

Sorry about the delayed response, I've been sick for the last few days with the flu. This worked and seems to be ok so thanks for your help. However I took your advice and have upgraded to php 8.1 but now what has happened is I get a blank screen at admin and the store front. I looked into the cubecart_system_error_log but I cannot see anything that makes sense to me that could be wrong, I have attached a screen shot.

Hope you can help

Best Regards,

Peterp

blank screen.pdf

Link to comment
Share on other sites

I am not finding handleError() in CubeCart's code.

As for the screenshot, please make the columns wider so that we can see the entire contents. The contents in the 'backtrace' column may need to be shown in a viewer of some sort, as the contents may be lengthy.

If you have any plugins, you may need to inhibit those until you can determine if any have a problem with PHP 8.1. Instructions on how to do that are in the file /includes/global.inc.php.

 

Link to comment
Share on other sites

Hi Brian,

I have looked in the /includes/global.inc.php for the instructions on how to inhibit the plugins but unfortunately I cannot see any instructions. Should I change the site back to using php 7.4 and check the plugins for their compatibility with php 8.1

Best Regards,

Peterp

Link to comment
Share on other sites

If you have the file /includes/global.inc.php-dist, it should have this statement, and others, as an example to use in the actual file /includes/global.inc.php:

$glob['safe_mode'] = false; // Set to true to disable hooks and code snippets, 'hooks' to disable code hooks and 'snippets' to disable code snippets

I would suggest not providing screen shots, but rather, in phpMyAdmin, click the Copy link of a row, and then paste what was copied into the forum's code edit window (use the <> toolbar button). Do that for several rows.

Link to comment
Share on other sites

High Brian,

I'm not sure that is what you want but I have highlight 3 lines

File: [controller.index.inc.php] Line: [28] "SET @@time_zone = 'Australia/Melbourne'" - Unknown or incorrect time zone: 'Australia/Melbourne'

[<strong>Notice</strong>]     C:xampphtdocschampcoclothingtestnewcacheskin7da4d98ec83af1522d93ff5e6afe4e8390b02f2f_0.file.box.newsletter.php.php:25 - Undefined index: DISABLE_BOX_NEWSLETTER

https://localhost/champcotesting/images/source/bisley_workwear_by_pip_logo.jpg

handleError() (7da4d98ec83af1522d93ff5e6afe4e8390b02f2f_0.file.box.newsletter.php.php:25)
content_64df13b502e0f9_71031783() (smarty_template_resource_base.php:123)
getRenderedTemplateCode() (smarty_template_compiled.php:114)
render() (smarty_internal_template.php:217)
render() (smarty_internal_templatebase.php:238)
_execute() (smarty_internal_templatebase.php:116)
fetch() (gui.class.php:1167)
_displayMailingList() (gui.class.php:367)

 

[<strong>Notice</strong>]     C:xampphtdocschampcoclothingtestnewcacheskinaf3fd85bdd9a602009daa35e9100595db374d12c_0.file.login.php.php:90 - Undefined index: USERNAME

https://localhost/champcoclothingtestnew/admin_ZlX9zy.php

handleError() (af3fd85bdd9a602009daa35e9100595db374d12c_0.file.login.php.php:90)
content_64e07010219076_17054137() (smarty_template_resource_base.php:123)
getRenderedTemplateCode() (smarty_template_compiled.php:114)
render() (smarty_internal_template.php:217)
render() (smarty_internal_templatebase.php:238)
_execute() (smarty_internal_templatebase.php:116)
fetch() (gui.class.php:342)
display() (admin_ZlX9zy.php:44)

 

[<strong>Notice</strong>]     C:xampphtdocschampcoclothingtestnewcacheskinaf3fd85bdd9a602009daa35e9100595db374d12c_0.file.login.php.php:90 - Trying to get property 'value' of non-object

https://localhost/champcoclothingtestnew/admin_ZlX9zy.php

handleError() (af3fd85bdd9a602009daa35e9100595db374d12c_0.file.login.php.php:90)
content_64e07010219076_17054137() (smarty_template_resource_base.php:123)
getRenderedTemplateCode() (smarty_template_compiled.php:114)
render() (smarty_internal_template.php:217)
render() (smarty_internal_templatebase.php:238)
_execute() (smarty_internal_templatebase.php:116)
fetch() (gui.class.php:342)
display() (admin_ZlX9zy.php:44)

hope this helps I have also put in a lines 

$glob['hooks'] = true;
$glob['snippets'] = true;

into global.inc.php.dist is this correct

Totally confused now

Best Regards,

Peterp

 

 

Link to comment
Share on other sites

In the file /includes/global.inc.php:

This file may be set as 'read-only'. If so, you will need to clear that setting so that it can be edited.

Find the last line:

?>

Above that, add this:

$glob['safe_mode'] = true; // Set to true to disable hooks and code snippets

This error: "Undefined index: DISABLE_BOX_NEWSLETTER" also shows the URL being requested -- an image file:

https://localhost/champcotesting/images/source/bisley_workwear_by_pip_logo.jpg

Does this image file actually exist?

And if not, look in the .htaccess file to determine if there is a rule that is supposed to show the index page if any request results in a 404 Not Found.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...