You are here:  » 18A Add to Shopping List from Search results


18A Add to Shopping List from Search results

Submitted by Antony on Tue, 2020-04-07 07:01 in

Hi David,

I'm using 18A, I've been trying to implement "adding to shopping list" directly from the search results by following node/6007 as its quite well explained, I get the link apprearing fine and whenever a product has been added from the product page it shows correctly in search results but when trying to add throught search results I get an error: Not Found. The requested URL was not found on this server.

Any chance to get this node updated to 18A?

I've also been trying to "IMPORT BY ID" as some of my products have the same names but should be within multiple categories. ie Men and Womens despite being the exact same product. Followed all instructions node/5034,3094,...
For this I've tested with a custom feed where I've personally entered each individual ID but no success or change at import.

Is the instructions up to date with 18A?

Thank you for your support in advance and let me know if you have any questions.

Antony

Submitted by support on Tue, 2020-04-07 07:45

Hello Antony,

I've updated this comment in node 6007 to use the tapestry_shoppingListHREF() function from 18/06A - that should be all it is regarding the shopping list URL.

Regarding Automatic Product Mapping by UID, the first thing to do would be that your ID values are being imported correctly. To do this, from /admin/ go to Tools > Feed Utilities and click Imported Analysis next to one of your feeds that you have added ID values for. Click on a product that you know should have an ID value and the full product record will be displayed - does your product ID show alongside the custom field name that you added for it?

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Tue, 2020-04-07 09:55

Hi David, thank you for your quick response,
The Cart is now functional on search results, thou would there be a way to remain within the search results rather than being directed to the cart?

I guess the following is also from previous versions and I could not implement elsewhere:

header("Location: ".$config_baseHREF."shoppingList.php");

...and REPLACE with:

header("Location: ".$_SERVER["HTTP_REFERER"]);

Then, Yes the product ID show alongside the custom field name that Ive added for it. Just gone through the test feed to ensure that all IDs are unique as well

Both Scripts uiddbmod.php, uidmap.php have also processed fine and I've ensured to add $config_uidField = "id"; to config.advanced.php

despite trying several and various attempts Im still missing products and the Imported Analysis shows Duplicated name wich is the obvious reason.

Many thanks for looking into this.

Ant

Submitted by support on Tue, 2020-04-07 11:07

Hi Ant,

For 18/06A to return to the current page after adding an item edit shoppingList.php and look for the following code at line 16:

    header("Location: ".tapestry_shoppingListHREF());

...and REPLACE with:

    header("Location: ".$_SERVER["HTTP_REFERER"]);

Regarding mapping by unique ID, bear in mind that the duplicate prevention is still based on merchant+product name; so if Parse Analysis is reporting duplicates that would indicate the same merchant (don't forget that you can have a single feed containing multiple merchants as long as there is a field that contains the merchant name).

uidmap.php (run after a full import e.g. as part of your cronjob as described in the setup instructions) will then match together any products from different merchants with the same ID - let me know if you're still not sure or not working as expected and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Tue, 2020-04-07 12:26

Hi David,

Shopping list now working great thanks!

In terms of UID I think the simplest way for me would be to research duplicated through Parse Analisys and manually twick the product names to a unique one - very simple and managable as they are very few of them and pointed through Admin. So all good there.

Got another questions thou, I would like to remove the decimals in prices. ie £10.00 should be £10

Ive looked at node/4867 and 980 but its not quite what I need.

Further more, I do have some free products, thou products at Zero (0) price do not import (Invalid price on Parse Analisys) it's is okay as I have been able to import by simply pricing them with double zero 00 on feeds. Is there a way to convert the 00 curently 00.00 to ie: "Free Item"?

Many thanks again!

Ant

Submitted by support on Tue, 2020-04-07 12:34

Hi Ant,

Sure - there's a single function - tapestry_price() - in includes/tapestry.php that displays price values throughout the site. To show FREE or remove the decimals, look for the following code beginning at line 308:

    $price = str_replace(".",$config_currencySeparator,$price);
    return ($config_currencyHTMLAfter?$price.$config_currencyHTML:$config_currencyHTML.$price);

...and REPLACE with:

    if ($price=="0.00")
    {
      return "FREE";
    }
    else
    {
      return $config_currencyHTML.intval($price);
    }

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Tue, 2020-04-07 17:47

Sorry to bother you David but Ive notice the "Remove all" within the shopping list is no longer working, the only significant change Ive made to shoppingList.php was at line 16: header("Location: ".tapestry_shoppingListHREF()); ==>changed to==> header("Location: ".$_SERVER["HTTP_REFERER"]);
Could this cause the malfunction?

Thanks

Ant

Submitted by support on Wed, 2020-04-08 08:03

Hello Ant,

That change shouldn't affect removal at all - does removing an individual item work? What happens when you click Remove All - does it just reload the page with all items still displayed?

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Wed, 2020-04-08 08:28

Hi David,

Individual item removal works fine, yes it just reloads the page with all items still displayed.

Thanks,

Ant

Submitted by support on Wed, 2020-04-08 08:50

Hello Ant,

That's strange it looks like setcookie() or browser behaviour may have changed regarding clearing cookies - I will look into this further. In the mean time, to fix edit includes/tapestry.php and look for the following code at line 537:

      setcookie(tapestry_shoppingListCookieName(),"");

...and REPLACE with:

      $shoppinglist = array();
      setcookie(tapestry_shoppingListCookieName(),serialize($shoppingList),strtotime("+90 days"),"/");

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Wed, 2020-04-08 09:25

Ok, got it to work by doing the suggested swap but at line 545 (added line at 310 yesterday)

545: setcookie(tapestry_shoppingListCookieName(),"");

So its working fine now and Im okay with it, whats the difference?

Submitted by support on Wed, 2020-04-08 09:48

Hi Ant,

For some reason setting the cookie to "" isn't clearing it - i'll investigate further but setting to empty array works fine...

Cheers,
David.
--
PriceTapestry.com