disco_ii_disco
-
Posts
115 -
Joined
-
Last visited
Posts posted by disco_ii_disco
-
-
The <span> has saved in the code snippet but doesn't get printed out in the gui message (viewed the page source and it is not there).
I am not going to worry too much about that though.
-
Many thanks. Wouldn't have figured that one out myself!
It still won't allow the <span> part but the link was the main thing.
-
Sorry, still on this subject, does anyone know if (or how) you can include html in the setNotify message?
Everytime I include html in the code snippet it get's stripped back out.
e.g. (this is want I would like):
{php} if (isset($_POST['buyproduct'])){ $GLOBALS['smarty']->assign('ADDED', "Product added to <a href='basket'>basket <span class='glyphicon glyphicon-cart'></span></a>"); } {/php}
-
The web API would basically do the "talking" between CubeCart and your Epos software, to ensure everything is in sync.
I am currently building something similar with a Microsoft Access till/management system. (I have just managed to get it to download the sales at a click of a button)
Would be interested to hear if you find any good software "off-the-shelf" though.
-
Would the best option be to change the canonical urls for each category page to either the first page or the view all page?
I am addressing this in my new Cubecart 5 store now.
-
Thank you. I just added this snippet (with the trigger: class.cart.add.preredirect):
{php} $message ="Product added to your basket."; $GLOBALS['gui']->setNotify($message); {/php}
All works and means no modifcation of the Cubecart code either, which is good.
Another job ticked off my list. Lots to go though!
-
Cheers Bsmither for the clarification.
The skin is a custom one I am building for my own shop. In my old store, the add to basket message appeared at the top of the central column (when a product is added to basket on the product or category pages).
In my new store - built on Bootstrap - I will either have a pop-up modal box (like ModsIndex has done) or a dismissable alert across the top of the page.
Had a quick play around tonight and got it to work instantly!
- I commented out the redirect parts of the add() function in cart.class.php - approx. lines 421, 423, 428 and 431.
- I gave the buy button on the content.product.php template the name "buyproduct"
- I created this small code snippet (with class.cubecart.display_product as the trigger):
{php} if (isset($_POST['buyproduct'])){ $GLOBALS['smarty']->assign('ADDED', "Product added to basket"); } {/php}
4. Then in product template:
{if isset($ADDED)} <p>{$ADDED}</p> {/if} //will improve on this once working!
Do you see any issues with removing the re-directs? Everything appears to work from my end!
Cheers,
Chris
-
I am currently working on something similar for CubeCart 5.... I think.
For my old Cubecart 4 store I created URLS like: http://www.caravanaccessoryshop.co.uk/brand/Kampa
Is this the kind of thing you are trying to achieve?
If so, I can keep you posted on what I come up with in the next week or two.
-
Hi all,
Just upgrading from Cubecart 4 to Cubecart 5.
On my old store I have an added to basket message which displays when "added=1" is present in the url e.g. product/jockey-wheel-clamp-34mm/4599?added=1
My old code was:
if (isset($_GET['added'])) { $view_prod->assign("TXT_ADDED_TO_BASKET", "<div class='txtAdded'><h3>Thank you for adding the ".validHTML($prodArray[0]['name'])." to your <a href='/index.php?_g=co&_a=cart'>basket</a>.</h3></div>"); }
My new code is:
{php} $GLOBALS['smarty']->assign('ADDED', "Product added to basket"); {/php}
Which trigger should I use to action the new version of this code?
I have tried class.cart.add.save, class.cart.add.update and others to no avail so far.
Any help would be greatly appreciated.
Chris,
-
Oops.. spoke to soon.
There is still a problem with the sql and getting the category id in to it. When I substitute:
'.$category['cat_id'].'
for:
217
(for example) it works.
Can $category['cat_id'] be used in display_category triggers?
-
Hi bsmither,
Your advice pointed me in the right direction.
The php error message related to a different code snippet (which I had deleted from admin but was still in the includes/extra folder).
Once I realised there was no error caused by the snippet I looked more closely at the output code and realised I had typed it in to a section which is only visible if the category has no image!
Three hours wasted but another few CubeCart 5 lessons learned!
Regards,
Chris
-
Hi all,
I have created a simple mysql table (related_articles) and a simple code snippet (code below) which has the display_category trigger:
{php} if ($related_articles = $GLOBALS['db']->query('SELECT `id` AS articleId, `description` AS articleDescription, `url` AS articleUrl, `type` AS articleType FROM `related_articles` WHERE `type` = "cat" AND item_id = '.$category['cat_id'].' ORDER BY `id` DESC')) { foreach ($related_articles as $related_article) { $related_article_vars[] = $related_article; } $GLOBALS['smarty']->assign('RELATED_ARTICLES', $related_article_vars); } {/php}
However, I am getting this error message in my logs:
PHP Fatal error: Call to a member function assign() on a non-object in /includes/extra/snippet_1679091c5a880faf6fb5e6087eb1b2dc.php on line 15
It appears the $GLOBALS['smarty']->assign() is not working as it should. All the sql is fine.
I have been battling with this for a few hours now so hopefully someone can point out an obvious error!
Kind regards,
Chris
-
I have the same problem.
Can anyone help?
-
Was a problem with my web host which they have just fixed for me.
Was a bit worrying for a moment.
-
Hi all,
My site has been up and running successfully for a couple of years.
Suddenly I can't access the site though. I am faced with a list of errors regarding the ini.inc.php file and also MySQL errors.
Here is my site: www.caravanaccessoryshop.co.uk
Can anyone suggest whether it is problems regarding my web host or have I been hacked?
Cheers,
Chris
-
Finally cracked it.
Have been searching for a solution to this for years!
I edited the fullTextIndex in the inventory table of the databse. I replaced the description field with the metaKeyWords field and now I have a very effective search! Woo hoo!
-
Since upgrading to CubeCart 4 I have had several customers who have said they have been unable to place an order.
I have not been able to replicate their problem.
I know there is a bug which makes ordering a product from search results not possible - has this been reported/fixed in versions after 4.1?
Chris.
-
I had an idea to search just the title and keywords of each product (i.e not the description). Ihave been through and added keywords to every product.
I am struggling for a way to implement this though.
Any advice - anyone??
Cheers,
Chris
-
Hi,
You've taken that picture off the homepage. Forgot to say I've only protected images on product pages.
There are still lots of ways to copy the images but they take a lot longer than a simple right-click or drag to the tab bar.
Cheers,
Chris
-
Just cracked it!
I'm using KitaBlue skin and replaced line 14 in styleTemplates/content/viewProd.tpl with:
<div style="background-image: url({IMG_SRC}); background-repeat: no-repeat; background-position: center; width:300px; height:300px; vertical-align:middle; margin:0 auto;"><img src="images/general/px.gif" alt="{TXT_PRODTITLE}" width="300px" height="300px" title="{TXT_PRODTITLE}"></div>
See it in action on my website: Caravan Accessory Shop
If someone really wants to steal an image they will but this makes it a little harder for someone to go and take every image.
-
The billing address codes are the same the delivery address ones but without "_d" at the end.
For example:
$result[0]['name_d']
becomes...
$result[0]['name']
Just copy everything inside <div class="deliveryAddress">
Find and replace the "_d"s and you'll be sorted.
-
I'm with you on this.
The search is pretty useless.
On my website:
A search for "propane regulator" does not result in a propane regulator being top of the list!
A search for "inner tent" results in several other products - many not containing the word "inner" - above an actual inner tent!
I have desperately tried to edit the way the search works but am having no luck at all.
-
I am trying to protect images on my website as I have spent a lot of time taking them and editing them.
I know that if they are on the web you can't prevent them being copied but you can make it a little harder for people to do so.
I disabled right-clicking for a while but I find sites that do that very annoying - and with a bit of know-how it doesn't take long to get round it.
I've seen sites that put a transparent gif over each image - that is what I'm trying to incorporate but don't know really where to start.
Can anyone help?
Cheers,
Chris
-
Hi,
I managed to fix this by adding:
"COMMENTS" => $this->orderSum['comments'],
in to the classes/cart/order.php file - after:
$macroArray = array(
on line 260.
Then I added:
{COMMENTS}
around line 39 in langauge/en/email.inc.php - after:
'order_breakdown_1' => "Dear {RECIP_NAME},
Thank you for your order no: {ORDER_ID} placed on {ORDER_DATE} at: {STORE_URL}.
I also added the date that the order was shipped in the same way.
Cheers,
Chris
Category Products - default sort order by `in stock`, then `popularity
in Technical Help
Posted
Hi all,
Just in the process of developing my new Cubecart 5 store.
In my old v4 store I order category products, showing those that are in stock first. The "in stock products" are then sorted by popularity.
I am attempting to do this in v5.
I have the following query in the getCategoryProducts function (clas/catalogue.class.php):
This gets the products sorted correctly - in mysql - but they are then being "resorted" by Cubecart.
I am struggling to find where to override CubeCart's sorting function to leave this order intact!
I have tried removing numerous lines from getProductData() and getCategoryProducts() but no joy so far.
Any help would be appreciated.
Regards,
Chris