Jump to content

Crafty Clicks


Recommended Posts

I have installed crafty clicks from the market place using the lightning symbol and it is in my plugins, I have entered my access token and enabled it but nothiing is showing on the checkout page that relates to a postcode search! Any help as usual greatly appreciated.

Using the latest version of CC

Link to comment
Share on other sites

But does CubeCart know that?

Specifically, at checkout, does CubeCart show a UK address in the Billing Address and Delivery Address group of form fields? Or are they blank? Are there shipping charges listed without the indicator that says these are estimates only?

Link to comment
Share on other sites

According to how I understand the CraftClicks plugin works, it wants to give to the template two javascript files using a method that loads references to the files in the {$HEAD_JS} array.

The {$HEAD_JS} array is not found in skins designed for CC5 -- which includes Vector.

Are you comfortable with editing HTML files? We can try to add the array to the Vector template.

Or you could contact the publisher and ask if they have a version for CC5.

Link to comment
Share on other sites

In the Vector skin template file main.php, find:

	</head>
	<body id="section-{$SECTION_NAME}">

On a new blank line just above that, add:

      {foreach from=$HEAD_JS item=js}{$js}{/foreach}

Because we have edited a skin template, we need to clear the skin template cache. So, in admin, Maintenance, Rebuild tab, check the Clear Cache box and Submit.

Link to comment
Share on other sites

As a test, please add an HTML comment above and below what was added earlier. Such as:

<!-- Head_JS Insertion Point, Crafty Clicks -->
{foreach from=$HEAD_JS item=js}{$js}{/foreach}
<!-- HEAD_JS End -->

Then, if I don't see the comments, I will conclude that perhaps the cache was not cleared, or the wrong file edited.

Link to comment
Share on other sites

Please edit the post above and remove all that code.

<!-- Head_JS Insertion Point, Crafty Clicks --> {foreach from=$HEAD_JS item=js}{$js}{/foreach} <!-- HEAD_JS End -->
{foreach from=$HEAD_JS item=js}{$js}{/foreach}
<!-- Head_JS Insertion Point, Crafty Clicks --> {foreach from=$HEAD_JS item=js}{$js}{/foreach} <!-- HEAD_JS End -->

There is now three times what was needed to be added. Change the above, to just one instance:

<!-- Head_JS Insertion Point, Crafty Clicks -->
{foreach from=$HEAD_JS item=js}{$js}{/foreach}
<!-- HEAD_JS End -->

However, I now see that the browser is complaining that jQuery is not yet up and running when these functions are first seen.

So, for the Vector skin, move the above three lines from where they are now, and place them:

After:
		<!-- Plugin JavaScripts -->
		{foreach from=$JS_SCRIPTS key=k item=script}
			<script src="{$STORE_URL}/{$script}"></script>
		{/foreach}

This may also not work because I see the PayPal Acceptance javascript is also having a problem.

We may need to get creative in solving this for the Vector skin.

Link to comment
Share on other sites

What we will now try is to make Vector fetch the CraftyClicks javascript files directly, instead of trying to make Vector behave like a CC6 skin.

So, I will give you a set of instructions, and hopefully you will get what you want.

First, the statements you earlier added to the template main.php, you can delete.

Next, in the file /skins/vector/js/application.js, at the bottom:

Find:
    {bar: skin_path + '/js/plugins/jquery.bar.min.js'},
    {flexslider: skin_path + '/js/plugins/jquery.flexslider.min.js'}
);

Change to:
    {bar: skin_path + '/js/plugins/jquery.bar.min.js'},
    {craftyclick1: skin_path + '/js/plugins/crafty_postcode.class.js'},
    {craftyclick2: skin_path + '/js/plugins/craftyclicks.js'},
    {flexslider: skin_path + '/js/plugins/jquery.flexslider.min.js'}
);

Copy the following two files from the folder /modules/plugins/CraftyClicks/js/
crafty_postcode.class.js
craftyclicks.js
and place those copies in the folder /skins/vector/js/plugins/

In the file /skins/vector/templates/main.php:

Find:
		<!-- Plugin JavaScripts -->
		{foreach from=$JS_SCRIPTS key=k item=script}
			<script src="{$STORE_URL}/{$script}"></script>
		{/foreach}

Add BEFORE:
        <script>var trans_token = {Config::getInstance()->get('CraftyClicks','token')}</script>

Summary: We have copied CraftyClick files to a place where Vector can get them directly, and told Vector to get them directly.

Link to comment
Share on other sites

Please make this change:

From:
<script>var trans_token = {Config::getInstance()->get('CraftyClicks','token')}</script>

To:
<script>var trans_token = '{Config::getInstance()->get('CraftyClicks','token')}'</script>

I forgot the quote marks around the variable's value.

There is also another error regarding the /includes/extra/PayPal_acceptance.js file. We may have to do to it exactly the same steps as what we did for the CraftyClicks files.

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...