Page 293 of 356 FirstFirst ... 193243283291292293294295303343 ... LastLast
Results 2,921 to 2,930 of 3558
  1. #2921
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by simon1066 View Post
    This may be a bug/omission but given the complexities of this mod I wouldn't be surprised if I just didn't understand.

    When adding a product to the cart my config settings are such that the cart is not displayed and I instead get a popup saying for example:

    HTML Code:
    'Men's Red Shoe' was added to your basket
    If I do the same with a product priced by attributes and SBA, I get:

    HTML Code:
    was added to your basket
    eventually I found that in includes\extra_cart_actions\stock_by_attributes.php

    around line 1064
    Code:
    // display message if all is good and not on shopping_cart page
                if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
                  $messageStack->add_session('header', ($_SESSION['cart']->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
    needed to be changed to
    Code:
      // display message if all is good and not on shopping_cart page
                if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
                  $messageStack->add_session('header', ($_SESSION['cart']->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . '\'' . zen_get_products_name($_POST['products_id']) . '\'' . SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
    so that the zen_get_products_name function is called when adding a 'SBA' product to the cart.
    Haven't yet dug into the likely cause for the "difference", but could you identify the version of ZC in which this occurred and any other plugins that may be associated? I'm curious if there is an issue with loading sequence of the define or some other information that might cause that minor difference (ie. If perhaps there was a change in the shopping_cart class that did not get picked up into the extra_cart_actions file.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2922
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Sure,

    v1.5.5.f (PHP 7.1.9)
    SBA (latest from Github)
    CEON
    CSS/JS Loader
    DPU
    Flexible Attributes
    GDPR4ZC
    Lazy Loader
    SNAF
    User Tracking
    Zen Magnific
    Dynamic Filter
    OPC
    Structured Data
    Template: modified Stirling Grand

    I used this code from my \classes\shopping_cart.php as a guide
    Code:
    // display message if all is good and not on shopping_cart page
          if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
            $messageStack->add_session('header', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . '\'' . zen_get_products_name($_POST['products_id']) . '\'' . SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
    but I note now that this is not part of the v1.5.5f stock install, and I'm not entirely sure which mod made that change. The default behaviour would be to display
    HTML Code:
    Successfully added Product to the cart ...
    with no mention of the product name.
    Simon

  3. #2923
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Edit: cancel this post I was in error
    Simon

  4. #2924
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by simon1066 View Post
    Edit: cancel this post I was in error
    Darn, and I didn't load a forum page to know what was posted here. :) anyways, I had come across the same conclusion about the difference between a default install and the change(s) made to this site. The product name is not part of the default install, but at least you were able to find the area of code causing the difference. Good job and thank you for posting your solution. If only the associated plugin could be identified then the solution could be better discussed. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #2925
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Yes, this will teach me not to make notes. Looking at my archives it seems that it was me, not a mod, that made the change to shopping_cart.php. No doubt I've reached the age where I should stop reyling on my memory. :)
    Simon

  6. #2926
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by simon1066 View Post
    Yes, this will teach me not to make notes. Looking at my archives it seems that it was me, not a mod, that made the change to shopping_cart.php. No doubt I've reached the age where I should stop reyling on my memory. :)
    Notes of some type or comparison back to the original are always good. :) regardless you approached it from a direction of uncertainty. I too had come to the same conclusion that the change had been made for some other reason. Ideally such a change would use a method that would substitute the product's name into the defined string rather than always prepending it to the remainder of the text as not all languages place the product's name first in such a sentence. May make a code suggestion even if the content wouldn't resolve to what was demonstrated...

    Regardless of age, keep up with what you're doing. Again, thank you for pointing out an area that might need some touching when using SBA and one of those plugins or just for more specificity of what was added to the cart.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #2927
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by mc12345678 View Post
    Notes of some type or comparison back to the original are always good. :) regardless you approached it from a direction of uncertainty. I too had come to the same conclusion that the change had been made for some other reason. Ideally such a change would use a method that would substitute the product's name into the defined string rather than always prepending it to the remainder of the text as not all languages place the product's name first in such a sentence. May make a code suggestion even if the content wouldn't resolve to what was demonstrated...

    Regardless of age, keep up with what you're doing. Again, thank you for pointing out an area that might need some touching when using SBA and one of those plugins or just for more specificity of what was added to the cart.
    Thank you for the vote of confidence. I see what you mean re the language files. So, although it's not directly SBA related, in case anyone wants to display the product name in the 'added to cart' message; I've removed my edits to includes/extra_cart_actions/stock_by_attributes.php and includes/classes/shopping_cart.php and instead in includes/languages/english.php made the following change:

    Code:
      define('SUCCESS_ADDED_TO_CART_PRODUCT', 'Successfully added Product to the cart ...');
    Code:
     define('SUCCESS_ADDED_TO_CART_PRODUCT','\'' . zen_get_products_name($_POST['products_id']) . '\'  was added to your basket');
    used 'basket' for the UK and added quotes around the product name mainly because this site is for artwork and I like to highlight the name.

    Edit: As I have moved the message to the top right corner of my site (just below the cart icon) I truncated it by removing the ...
    Last edited by simon1066; 26 Jun 2018 at 09:12 AM.
    Simon

  8. #2928
    Join Date
    Dec 2014
    Location
    Beekbergen, Netherlands
    Posts
    5
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Zen Cart version = 1.55d
    SBA Version 1.5.4 for Zen Cart Version 1.5.5d

    We have a problem with rounding of prices of products with attributes
    One of our attributes has a price of €23.5849 excl 6% VAT ( 23.5849 * 1.06 = €24,999994 )
    the SBA lists a incl price of €25,00
    however if we add one to the shopping-cart it is listed as €24,99

    Please advise us to what possible solutions there are

  9. #2929
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by Marc Boon View Post
    Zen Cart version = 1.55d
    SBA Version 1.5.4 for Zen Cart Version 1.5.5d

    We have a problem with rounding of prices of products with attributes
    One of our attributes has a price of €23.5849 excl 6% VAT ( 23.5849 * 1.06 = €24,999994 )
    the SBA lists a incl price of €25,00
    however if we add one to the shopping-cart it is listed as €24,99

    Please advise us to what possible solutions there are
    This issue is not directly related to SBA, but is something associated with internal calculations of ZC and possibly/likely separate at least what I consider incorrect usage/application of product VAT pricing. I am not a tax qualified individual, so please take this with a grain of salt. As can be seen, the non-taxed cost of the product is shown as 23.5849... Unless that is the cost of a single item that was purchased in bulk, I find it difficult to say that anyone was able to provide a currency amount that resulted in that price. Yes, it makes the final price look good/right, but in a way it doesn't make sense as anyone purchasing the product without VAT will not pay that amount. They will pay either more or less than the identified per quantity product unless they purchase at least a hundred of them.

    So, some fixes that have been suggested/applied are either a code change (there was something posted late last year if I remember correctly, but would have to search for it), a slight modification of the tax value (say 5.9999% but display only 6%), or an expansion on the data stored to include one additional decimal place, to name a few. I think I've seen a few others, but usually it is dependent on what is being seen and the specific product price. There are a few specific prices/tax rates that result in such "loss" of a penny...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #2930
    Join Date
    Dec 2014
    Location
    Beekbergen, Netherlands
    Posts
    5
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by mc12345678 View Post
    This issue is not directly related to SBA, but is something associated with internal calculations of ZC and possibly/likely separate at least what I consider incorrect usage/application of product VAT pricing. I am not a tax qualified individual, so please take this with a grain of salt. As can be seen, the non-taxed cost of the product is shown as 23.5849... Unless that is the cost of a single item that was purchased in bulk, I find it difficult to say that anyone was able to provide a currency amount that resulted in that price. Yes, it makes the final price look good/right, but in a way it doesn't make sense as anyone purchasing the product without VAT will not pay that amount. They will pay either more or less than the identified per quantity product unless they purchase at least a hundred of them.

    So, some fixes that have been suggested/applied are either a code change (there was something posted late last year if I remember correctly, but would have to search for it), a slight modification of the tax value (say 5.9999% but display only 6%), or an expansion on the data stored to include one additional decimal place, to name a few. I think I've seen a few others, but usually it is dependent on what is being seen and the specific product price. There are a few specific prices/tax rates that result in such "loss" of a penny...
    We have this problem only with products that use SBA.
    The price in orders_products gets rounded to 2 decimals somehow, where the pricein orders_products_attributs is shown correctly
    see icture, top is orders_products, below orders_products_attributes
    Name:  WhatsApp Image 2018-08-03 at 12.32.23.jpg
Views: 214
Size:  16.5 KB

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR