Jump to content

bsmither

Member
  • Posts

    17,980
  • Joined

  • Last visited

  • Days Won

    603

Posts posted by bsmither

  1. Probably. The seo 'path' that gets associated with product 22 shouldn't change at all, once created and databased. So, the query that uses this path to figure out the product ID value would naturally come from CubeCart's cache.

    However, I don't know what would have been cached that would have caused CubeCart to not find the proper product ID.

     

  2. In /classes/cubecart.class.php, near line 2623 (CC652), begins a block of code that tests if the shipping method used has a shipping module.

    At lines 2636 and 2646, there is code that formats 'ship_date'. Additional statements can be added just above those two statements:

    Find in two locations:
    
    'date'  => (!empty($order['ship_date']) && $order['ship_date']!=='0000-00-00') ? formatDispatchDate($order['ship_date']) : ''
    
    Add above each location:
    
    'alt_ship_date'  => (!empty($order['alt_ship_date']) && $order['alt_ship_date']!=='0000-00-00') ? formatDispatchDate($order['alt_ship_date']) : '',
    'venue_ship_product'  => $order['venue_ship_product'],
    'all_shipping_used'  => $order['all_shipping_used'],
    

    Then, in the skin, add the necessary HTML to show these new elements of the $DELIVERY array.

  3. In the "Switching Power Supply" category, I found the 110V variant, but not the 220V variant, in the listing.

    On the 220V variant product's admin details, General tab, are you sure the product has its Status checkbox checked? Might there be something entered in the "List from" date entry field? Might it be out of stock and the store settings say to hide out of stock? Might it be assigned a primary category, other than Switching Power Supply", where that category is disabled?

     

    Well, scratch all that. I see the 220V variant just below the 110V variant in the listing - just with a wildly different Name.

    Please determine the product_ids (21 for the 110V variant) of these tow items. Then using an external database utility, look in the table CubeCart_seo_urls and find the rows for those item_id's of type prod.

    Compare the path with what you expect.

  4. When the admin is updating an order, specifically when changing an order to Complete ('status' = 3), there is code in the admin /sources/ file orders.index.inc.php, near line 208, that tests for the presence of a manually entered 'ship_date'.

    If not present (or empty), then today's date will be used.

    I haven't checked if a query for an order's summary was fetched from the cache (I would assume so because, eventually, the order's details won't change over time) caused by the customer wanting to see their order history. Therefore, after Saving the order summary from admin, the admin would need to have CubeCart clear its internal cache, then the customer would need to refresh their view of the order's details.

    "I use a database called all_ship_date, venue_ship_product, and all_shipping_used."

    Where are these database tables located? In the same database as are all the other "CubeCart_abc" database tables?

    If so, then code could be added (likely through a code snippet) to JOIN that data into $Smarty's $DELIVERY array.

    If not, while not impossible, a much more complicated effort would be involved to fetch the relevant data.

  5. In my opinion, those parenthesis should have caused a different problem, resulting in not showing that content at all.

    Very strange!

    Parentheses are used to force an "order-of-math-operations", or as a "container" of function arguments. But, since there was no function name preceding the function argument "container", PHP should have complained about something wrong with the statement syntax.

    However, this was inside braces - which are reserved for Smarty statements. Thus, Smarty will "parse" its statements, compiling them into real PHP statements. You can see the compiled result files in the /cache/skin/ folder.

    For myself, the process by which Smarty parses its statements, and how it deals with anomalies, is unknown. Therefore, why Smarty would use "stored/cached" contents of a variable, let alone where those contents could possibly be stored/cached -- I have no idea.

    I do plan to conduct my own experiments to try to replicate this situation.

  6. The files that have been modified to show Best Products Sold in a given time frame, and Best Customers in a given time frame are ready for testing.

    I will try to attach the ZIP file to this post. But if the forum no longer allows it (I used to be able to do this), send me a PM with your email address and I will send them to you.

    Well, the message said the upload failed. So, if interested, ....

     

  7. We know that editing the product's description (having put the code in Angel and Child) does show the changes on the storefront.

    Please show the custom template code (5 lines before and 5 lines after) where the Smarty variable $PRODUCT.related_used_with is located.

     

  8. Again, I assume you had CubeCart clear its internal cache after saving the edited data. That is necessary because the result from the query in the Catalogue class, function getProductData(), the database record will be pulled from CubeCart's internal cache - if it exists.

  9. "Do I need to add the related_used_with and specs to the product description?"

    You shouldn't have to. The content of the 'related_used_with' editor, being databased in a new column of the CubeCart_inventory database table, then retrieved as an element of all data found in that record, should be part of Smarty's $PRODUCT array. (I assume you had CubeCart clear its internal cache after saving the edited data.)

  10. I see that in admin, there is a dedicated editor for 'related_used_with' - and I assume there is a database column for it.

    Have CubeCart's debug mode enabled. Save the edit screen after making sure that the class="th" is part of the <img> tag as seen above.

    In the debug window, CubeCart will show what was received in the POST payload. Confirm the <img> tag has the class="th" attribute.

    If this attribute is not present, then we might think that the editor is stripping it away. Which is strange.

     

  11. You are saying that your plugin adds to CubeCart's router? Or does it add to CubeCart's query listener? The router delivers a whole page, the listener responds with either a JSON string or HTML snippet. (There is also a do-something listener that is not meant to return anything.)

     

  12. Let's try this - your skin code may be very slightly different, especially the classes.

    In the skin CSS file cubecart.helpers.css, at the end, add:
    
    .hide-important {
      display:none!important;
    }
    
    The skin template element.product.horizontal_gallery.php, replace all the code with:
    
    <div class="row">
       <div class="small-5 medium-7 columns horizontal">
             <a href="#" class="open-clearing" data-thumb-index="0"><img src="{$PRODUCT.medium}" alt="{if isset($PRODUCT.image_tags.medium.alt) && !empty($PRODUCT.image_tags.medium.alt)}{$PRODUCT.image_tags.medium.alt}{else}{$PRODUCT.name}{/if}"{if isset($PRODUCT.image_tags.medium.title)} title="{$PRODUCT.image_tags.medium.title}"{/if} id="img-preview"></a>
          <ul class="{if !is_array($GALLERY) || count($GALLERY) < 2}hide-important {/if}clearing-thumbs small-block-grid-3 medium-block-grid-5 marg-top" data-clearing>
             {foreach from=$GALLERY item=image}
             <li><a href="{$image.source}" class="th"><img src="{$image.small}" data-image-swap="{$image.medium}" data-caption="{$PRODUCT.name}{if !empty($image.image_tags.title)}: {/if}{$image.image_tags.title}" class="image-gallery" alt="{if isset($image.image_tags.alt) && !empty($image.image_tags.alt)}{$image.image_tags.alt}{else}{$image.name}{/if} - {$LANG.catalogue.click_enlarge}"{if isset($image.image_tags.title)} title="{$image.image_tags.title}"{/if}></a></li>
             {/foreach}
          </ul>
       </div>
       <div class="small-7 medium-5 columns">
          {include file='templates/element.product.options.php'}
          {include file='templates/element.product.review_score.php'}
          {include file='templates/element.product.call_to_action.php'}
       </div>
    </div>
    
    The skin template element.product.vertical_gallery.php, replace all the code with:
    
    <div class="row">
       <div class="medium-1 columns thinpad-right off-canvas-for-small vertical">
          <div id="scrollUp" class="scroller"><svg class="icon"><use xlink:href="#icon-angle-up"></use></svg></div>
          <ul class="{if !is_array($GALLERY) || count($GALLERY) < 2}hide-important {/if}clearing-thumbs small-block-grid-1" id="scrollContent" data-clearing>
             {foreach from=$GALLERY item=image}
             <li><a href="{$image.source}" class="th"><img src="{$image.small}" data-image-swap="{$image.medium}" data-caption="{$PRODUCT.name}{if !empty($image.image_tags.title)}: {/if}{$image.image_tags.title}" class="image-gallery" alt="{if isset($image.image_tags.alt) && !empty($image.image_tags.alt)}{$image.image_tags.alt}{else}{$image.name}{/if} - {$LANG.catalogue.click_enlarge}"{if isset($image.image_tags.title)} title="{$image.image_tags.title}"{/if}></a></li>
             {/foreach}
          </ul>
          <div id="scrollDown" class="scroller"><svg class="icon"><use xlink:href="#icon-angle-down"></use></svg></div>
       </div>
       <div class="small-5 medium-6 columns text-center nopad">
             <a href="#" class="open-clearing" data-thumb-index="0"><img src="{$PRODUCT.medium}" alt="{if isset($PRODUCT.image_tags.medium.alt) && !empty($PRODUCT.image_tags.medium.alt)}{$PRODUCT.image_tags.medium.alt}{else}{$PRODUCT.name}{/if}"{if isset($PRODUCT.image_tags.medium.title)} title="{$PRODUCT.image_tags.medium.title}"{/if} id="img-preview"></a>
             <p class="show-for-small-only">{if is_array($GALLERY) && count($GALLERY) > 1}{$LANG.catalogue.tap_gallery}{else}{$LANG.catalogue.tap_enlarge}{/if}</p>
       </div>
       <div class="small-7 medium-5 columns thinpad-left">
          {include file='templates/element.product.options.php'}
          {include file='templates/element.product.review_score.php'}
          {include file='templates/element.product.call_to_action.php'}
       </div>
    </div>
    

    What this does is to make use of the same code when: there is only one assigned image (so, normally the gallery is not shown), or several assigned images. And this code will show the "colorbox" - again, whether or not the gallery has more than one image to be shown.

    You said your content.product.php template file has all of the {includes} included already, but you should be able to easily find where to make the edits.

    After editing the CSS file, be sure to have CubeCart clear its internal cache so that the edited file can be included in a new cached "squeezed" master CSS file.

  13. CubeCart is coded, when there is only one image for the product, that the main image has a direct link to the actual source image (/images/source/image.png).

    When there is more than one image for this product, Cubecart has code to show a "Colorbox" showing that image along with a scroller of thumbnails along the bottom edge.

    The Colorbox is coded to show the image attributes.

    But, when the browser fetches an actual image without benefit of any HTML code around it (such as within an <img> tag), there is nothing to show but the raw image. Please note the browser's address bar showing the URL of the actual image's location.

    A 'Feature Request' can be made in the Github to show the largest size image in a Colorbox for the case where there is only one image assigned to a product.

    (Let's ignore the popup issue for the moment. You say the "debug info". This may be CubeCart's debug info. If so, then Smarty's debug window might be located at the same location at the same size as CubeCart's debug window. If so, move or close CubeCart's debug window to see Smarty's debug window.)

  14. I am using Firefox, and I see a title: Scented Tarts Wax Melts (4) Four Pc Packs - Lot 1

    I also see the alt content in the HTML code. So I know CubeCart and your skin is operating correctly:

    "Scented tart 4 squares to a pack. One pack each: Apple pie, sugar cookie, snickerdoodle, peanut butter crunch"

  15. Please make this short-term edit:

    In the skin template, content.product.php, at the very end, add:
    
    {if $smarty.server.remote_addr eq "a.b.c.d"}{debug}{/if}

    where a.b.c.d is your local IP address (www.showmyip.com) -- in quotes.

    This will show a Smarty debug popup (hopefully for you only). The popup will show the contents of the array $PRODUCT, and should contain the sub-array 'image_tags'. Verify that there exists in 'image_tags' the sub-array 'medium', and within 'medium', the elements 'alt' and 'title'.

×
×
  • Create New...