Error when trying to read same csv or update

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Error when trying to read same csv or update

Post by aimeos » 21 Oct 2016, 17:50

Got it! The problem was that prices and texts were limited by the currency and language of the locale item and you've tried to import prices with USD while the first locale entry is EUR I guess.

The fix is in dev-master of the aimeos/aimeos-laravel package now. Can you temporarily switch to that branch and execute "composer update"? Does it run smoothly afterwards?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alfredlaggner
Posts: 29
Joined: 12 Oct 2016, 03:18

Re: Error when trying to read same csv or update

Post by alfredlaggner » 21 Oct 2016, 21:57

After I tried to figure out why only some products show a price. They have a minimum amount of greater than 1! As soon as I set it to 2 or higher they show the price. I could not find the reason for that.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Error when trying to read same csv or update

Post by aimeos » 22 Oct 2016, 10:21

Did you use your example data set you've posted? It contains four prices per product but all prices have a minimum quantity of 1. That means that the lowest price (0.00) will be shown. All prices per product must have a different quantity greater or equal than 1.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alfredlaggner
Posts: 29
Joined: 12 Oct 2016, 03:18

Re: Error when trying to read same csv or update

Post by alfredlaggner » 22 Oct 2016, 15:29

Thank you very much aimeos!
CSV issue:
The problem did go away after I left only one currency in locale/list group. Now I know why.
I am not great with composer yet. Can you quickly tell me how to modify the settings to update to your corrected version? Right now I have this setting:

Code: Select all

    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "maatwebsite/excel": "~2.1.0",
        "aimeos/aimeos-laravel": "2016.10.x-dev"
    },


Four prices issue:
I fixed the price issue right away. And it works. My challenge is that some price categories have one price (quantity is pieces) and others have up to four prices per weight (quantity is grams, basically a discount if they buy more). I have to figure out how to resolve this on the front end. How do I show dynamically four prices for "weight products" and one price for "item products"?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Error when trying to read same csv or update

Post by aimeos » 22 Oct 2016, 16:25

Your composer.json is OK, you already use the 2016.10.x-dev branch. Simply do a "composer update" afterwards, your import should work if you have several entries in the Locale -> List tab.

Regarding prices:
I guess, you don't sell your products per gram but have packages like 250g, 500g, etc. Create articles for each package with one price and associate the articles to a selection product. For the selection product, use the lowest price. Then, your customers will be able to chose the package/article in a drop-down and pay the price of the selected article.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alfredlaggner
Posts: 29
Joined: 12 Oct 2016, 03:18

Imported prices with value 0 show up on front end

Post by alfredlaggner » 30 Oct 2016, 23:36

Ad I mentioned a while ago I am importing 4 prices for every product even I have only one price for many products.
On the frontend this creates an unwanted situation.

A 4 price product works perfectly as is.
Capture Product with four prices.PNG
Capture Product with four prices.PNG (9.1 KiB) Viewed 2714 times
However, if there is only one price I get an unwanted extra line.
Capture Product with one price.PNG
Capture Product with one price.PNG (7.76 KiB) Viewed 2714 times
A separate issue is tax. I finally got it to calculate the right tax amount. (My import database has price with tax and price without tax but not the tax percentage). But my product will be sold in CA and only in CA. All it needs to display is "Tax" and the Tax amount. No percentages necessary.
Capture iax info.PNG
Capture iax info.PNG (5.08 KiB) Viewed 2714 times
I know I should use decorators. but this is challenging for me since I am new to both aimeos and Laravel. Please, can you point me in the right direction? I am spending a lot of time on your documentation. It is very thorough but lacks samples and tutorials. I believe aimeos is a great product but its potential will grow exponential when you have more "how to ..." chapters. I saw you are working on a new version with easier configuration. Any idea when?

Thank you again for your prompt help. It is highly appreciated!

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Imported prices with value 0 show up on front end

Post by aimeos » 31 Oct 2016, 18:08

alfredlaggner wrote:Ad I mentioned a while ago I am importing 4 prices for every product even I have only one price for many products. On the frontend this creates an unwanted situation.

A 4 price product works perfectly as is.
However, if there is only one price I get an unwanted extra line.
Did you leave the values for the unused price columns empty? As soon as the price value is an empty string, no price record should be created.
alfredlaggner wrote:A separate issue is tax. I finally got it to calculate the right tax amount. (My import database has price with tax and price without tax but not the tax percentage). But my product will be sold in CA and only in CA. All it needs to display is "Tax" and the Tax amount. No percentages necessary.
You can overwrite the price partial to get whatever you need:
https://github.com/aimeos/ai-client-htm ... efault.php
alfredlaggner wrote:I am spending a lot of time on your documentation. It is very thorough but lacks samples and tutorials. I believe aimeos is a great product but its potential will grow exponential when you have more "how to ..." chapters.
Where are you missing more samples and tutorials?
alfredlaggner wrote:I saw you are working on a new version with easier configuration. Any idea when?
We are currently refactoring the subparts and templates to to make it easier for agencies to adapt the frontend to existing HTML code if that is what you mean. This and other breaking changes will be part of the release in January 2017. You can already have a look at https://github.com/aimeos/ai-client-html/commits/master
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply