Jump to content

Would like to display date & Product total on Store


Dirty Butter
 Share

Recommended Posts

I tried picking up this code from dashboard.index.php for the product total, but wasn't overly surprised when it didn't work - it was worth a try lol.

<dt>{$LANG.dashboard.inv_products}</dt>
            <dd>{$COUNT.products}</dd>

I'm assuming I would need a script to get today's date, and there is bound to be some way to get the total on the store front. Anyone able to help with this?

My reason for wanting this is that there are many small toy stores online that seem to be active, but when you actually try to buy from them - they aren't working. They've just been left online dead as a door nail. We occasionally gets emails from potential customers wanting to know if our store is active or not. I realize displaying today's date isn't going to be enough, but it might help to allay fears. And I'm proud to advertise the number of items we have listed, which increases almost every day.

Link to comment
Share on other sites

Wherever you want the date to display, add this to the template:

{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}

Supposedly, $smarty is a valid variable. It just isn't found as being used in a template as far as I can tell.

I think there is a small plugin or patch that shows the number of inventory. I've seen this for CC5.

This might be interesting:

http://www.cubecartforums.org/index.php?showtopic=18110

Link to comment
Share on other sites

I think a much more illuminating indicator that will show your store is actively manned and engaged in business activities is to use the Product's "Date Updated" property.

If this date is recent, and is shown on, especially, the Latest Products page and the product's View Details page, then it is reasonable for the customer to assume the store management is actively pursuing new inventory.

Link to comment
Share on other sites

You're right - the Updated property probably would be more revealing, but would be helpful in our situation only for the Homepage. We do have many product listings that we sell over and over that were originally listed as far back as 2008. Maybe both? The Products listed as of date on all pages AND the updated date on each item on Latest Products?

Link to comment
Share on other sites

Manually updating at regular intervals might be an onerous management task. And certainly I suggest not having some automated process do it - even though the outward appearance would be no different than a legitimately updated product.

So, I think we have a solution for the Homepage Latest Products.

Are we still brainstorming a solution for some other page?

Link to comment
Share on other sites

Showing updated by each product should only be for Homepage for MY needs. I downloaded and installed Noodleman's plugin, but the hooks are not showing up. When I tried to enable the plugin it would not accept the check mark.

The Date Smarty code worked just fine. I'll have to decide if I want it all the way down to the second, but is definitely working correctly.

Link to comment
Share on other sites

Not having confirmed anything, I was afraid this might happen: that plugin is not recent which means the version of ionCube it is encoded with may not match the version of ionCube installed on your system. I don't know. (As an aside: I was incredibly disappointed with that plugin being as "freebeer" but not "freedom".)

Link to comment
Share on other sites

No debug or error messages regarding ioncube. Is there some other way I can check? Something I can install that you know will only work if ioncube loader is working properly?

I made the code active on the front page, even though it is not enabled in plugins, just to see what error message pops up.

Quote

[31-May-2016 15:39:04 UTC] PHP Warning:  Security Warning: Illegal array key "$Path" was detected and was removed. in /home/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 72
[31-May-2016 15:39:04 UTC] PHP Warning:  Security Warning: Illegal array key "$Domain" was detected and was removed. in /home/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 72

I suppose that's to be expected, as sanitize hasn't been told what the {$TOTAL_ENABLED_PRODUCTS} refers to.

Link to comment
Share on other sites

I would think PHP itself would complain if the ionCube Loader was not functioning, considering it does get listed in the PHP Info box.

A stupid suggestion for a means to check would be to install a copy of CubeCart 5 (a version that still implements a license check).

 

Link to comment
Share on other sites

A basic implementation would be:

In the template content.homepage.php, near the bottom, find:

            <input type="hidden" name="add" value="{$product.product_id}">

On a new blank line ABOVE that, add:

            <div class="row collapse marg-top">
               <div class="small-12 columns text-right">
                  Acquired: {$product.date_added}
               </div>
            </div>

 

Link to comment
Share on other sites

Right now I have this on homepage.php:

            {elseif $product.ctrl_stock && !$CATALOGUE_MODE}
            <div class="row collapse marg-top">
<div class="small-12 columns ">
      <a href="{$product.url}" title="{$product.name}" class="button small postfix">{$LANG.common.info}</a>
<h4>Added  {formatTime(strtotime($product.updated))}</h4>
               </div>

There's probably a much better way to do it , but it helps.

Link to comment
Share on other sites

The following (if PHP is allowed to display errors) will be shown if ionCube is missing, inoperative, or (slightly different wording for) wrong version:

Site error: the file /modules/plugins/Homepage_Counts_v1.0.0/admin/index.inc.php
requires the ionCube PHP Loader ioncube_loader_win_5.4.dll to be installed by the 
website operator. If you are the website operator please use the ionCube Loader 
Wizard to assist with installation.

 

Link to comment
Share on other sites

I am researching as we speak why CC6 will not allow me to enable the module from the Manage Plugins list. For some reason, the checkbox is being denied the ability to be checked.

My initial impression is that CC6011 (maybe earlier) has actually incorporated a check against the declared version compatibility in the module's config.xml file.

Nope. Makes no difference.

Link to comment
Share on other sites

My custom language phrases quit working. I've repaired the CubeCart_lang_strings table, just in case, but the custom strings that are being stored there are not currently being used. I'm not sure how long that's been the case.

But since this plugin was a v5, I decided to try disabling it before any further attempts to find the issue. Sure enough, when I disabled the homepage_count plugin, my custom language phrases returned! I certainly didn't expect THAT!!

Link to comment
Share on other sites

Morning,

I see you are chatting about one of my free modules. I am not entirely sure why there have been so many issues with the module. I tested it today using V6 and it worked OK. so perhaps there was some issue with the encoding of the module. Since this is a free module, no reason to encode it. It doesn't have any license requirements. I've replaced the encoded files with standard files so if you re-download the module you can modify it as required.

It's quite an old module, but also very simple so should just work. Also, no idea why it would break the languages. Very strange. perhaps try creating an XML file in the languages directory of the module that matches the default language of your store. In CC6 it should create them, but perhaps it didn't.

It's not the most graceful of code. This module was put together when I was starting to learn the CC hooks/plugin structures. :)

 

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.

 Share

×
×
  • Create New...