Laravel Crinsane Shopping cart install migration - laravel-5

Has anyone installed Crinsane/shoppingcart ?
In the installation documentation there is no mention of the migration for the table. There is no mention of the configuration of the database connection.
I can only assume that I am not very experienced with laravel, and it is probably something obvious that I do not know about.
Anyway: there is a config/cart.php file (in the vendor) where I found the database connection setting, but I have no idea on how to change it to make it work (I can only assume that I should change it because, of course, there is no table called shoppingcart in my application's database after I did my composer installation).
So I have this section in the cart.php file:
'database' => [
'connection' => null,
'table' => 'shoppingcart',
],
How should I set this up? What do I write in the "connection"?
After installation, my Cart is working but it has a strange behavior, and I can only guess that it happens because there is no DB table anywhere that would hold the cart data.
The strange behavior is that when I add an item to the cart, it ends up in the cart but when I refresh the page, the cart gets empty. But when I add 2-3 products to the cart, and then refresh the page, the cart contains all the items (minus the one that I added to the cart before). Also after I add the first product, when I try to add a new item to the cart it does not do it on the first click on AddToCart button. But when I click again, the second product gets added to the cart
I am sure I am doing something wrong, Can anyone help me with a more detailed installation tutorial?
EDIT
I ran the migration, and now I have the shoppingcart table in my database (without changing the database connection in the config.php file)
The behavior is the same. Nothing's changed
What should I do?

Use the methods:
Cart::store($this->authUser->id);
Cart::restore($this->authUser->id);

Related

Products disappeared on frontend after magento update

I updated my Magento to the version 1.9.2.4.
After the successful message, without any errors on Magento Connect, the product widgets carrousel at frontend don't show the products anymore.
Any idea to fix this?
My project URL is: http://104.131.94.62/
Thanks.
try reindexing and cache clear. It worked for me
I just got the answer.
Since the update 1.9.2.4, Magento updated it's security on the Widget Blocks. All you need to do is add this permissions at System > Permissions > Blocks.
After the new page loads, you'll see the widget blocks who have Magento permissions to load. To setup a new widget permission, just click on 'Add New Block'.
On next page, add your block type, like 'ultimo/product_list_featured' (you can get the block type at CMS > Pages). Select 'Allow' and click on save.
Refresh your cache and it's finished.
Thanks for the help.

Quantity in checkout shopping cart doesn't work properly for Magento

I have use Magento 1.9.0.1 and on live server the cart is working correctly. I change the quantity of a product in the cart then I push the "Update cart" button and all works fine. I transferred the site another domain and the cart quantity doesn't work anymore. As I change the quantity of a product and click the button the quantity remains the same. If I go back and try to add the same product to the cart, even if I specify a different quantity like 10 and not 1, in the cart only 1 item is added every time I click on "add to the cart" button and not 10 as specified. I cannot figure out where's the problem. I excluded my custom theme and rolled back to the default theme and the problem persist. this site other functionality work fine.
It looks like somewhere in your code you put tmp instead of $tmp. Run a search over all of your code for tmp. And Go through the function getTmpDir and check you have sufficient permission for tmp folder and access to write files in tmp.
When i can change my magento local time zone. than this problem is solve.

Magento Patch SUPEE-6788 breaks custom file option file link on cart page?

When executing file upload on a site with SUPEE-6788 applied, and then adding the product to cart, rather than present a URL to the uploaded file you get a chunk of text similar to this on the shopping cart page and also in the sales email generate. The file itself can be found in the quote folder so looks like the rerendered part of the page that should show the file link is bust.
a:10:{s:4:"type";s:10:"image/jpeg";s:5:"title";s:8:"2849.jpg";s:10:"quote_path";s:68:"/media/custom_options/quote/2/8/16156fb1e8320b06153ee7061a7b5cdf.jpg";s:10:"order_path";s:68:"/media/custom_options/order/2/8/16156fb1e8320b06153ee7061a7b5cdf.jpg";s:8:"fullpath";s:119:"
Has anyone else seen this issue.
** update **
This is still a problem after upgrading to 1.9.2.4.
Interestingly if you update and save the cart the uploaded file link is then rendered correctly. In the sales_flat_quote_item_option table where the product options in the cart are saved, the field holding the file link metadata is updated and it has changed. Some characters present in the value on the original cart submission are removed [see below]
;s:3:"url";a:2:{s:5:"route";s:35:"sales/download/downloadCustomOption";s:6:"params";a:2:{s:2:"id";N;s:3:"key";s:20:"d6e5b846b9f1f6b4298b";}}}
Therefore rather than a rendering issue it looks like a generation issue. Maybe the theme is involved. Will look at difference between writing and regeneration.
** Update **
OK solution found. The Application (Magento Theme + Modules) was, in a Mage_Checkout_CartController type, creating a product in the cart via code like this
$cart = $this->_getCart();
$params = $this->getRequest()->getParams();
$_product = $this->_initProduct();
$cart->addProduct($_product, $params);
This was creating a product that contained the File Upload option which was then stored in an invalid format.
A rework of the code removed the need to use the above code and the problem has gone. So there does seem to be a bug somewhere related to product creation and File Upload options but I've gone far enough on this journey for now.
Same here this problem is encountered within many instances, like product page, checkout page, order page (Magento CMS). First we thought it was about module update issue, but that didn't help, so right now we think it's a 1.9.2.2 bug.

Magento Hooks - Will Magento allow me to do this?

I'm going to be starting a E-Commerce project and the client is interested in using Magento. In this project, when a customer adds something to the cart, I'll need to pull them out of the flow, where they'll proceed through a custom wizard-esque area.
They basically design a document using a drag and drop interface. After they finish, that document will be saved as a PDF, and I want them redirected to checkout
So my questions are
Does Magento have hooks available for after an item is added to the
cart ?
If I pull them away to this other section of the site (Wizard
portion), changes they make will potentially add costs to
their cart. Would I still have access to products, prices, and the
cart so that I can continue to modify their cart until they return
to checkout ?
Magento users Event-Observer pattern, where you can hook into virtually any action which is performed and execute your custom code,
Refer to below links,
http://inchoo.net/category/ecommerce/magento/events-observers/
https://gist.github.com/peterjaap/6973324
http://huztechbuzz.wordpress.com/2014/04/26/complete-list-of-all-events-in-magento/
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
So you have to figure out which event you can use and plugin your custom code.
As long as i remember all the cart info ( products/prices ) is stored in the $_SESSION. So you can get all the information from there you need, modify it via your so-called wizzard and udpate the session information after that!
Cheers! :)

Magento 1.5.0.1 Items vanish from cart when user logs in at checkout

Here's a quick step by step of what's been happening.
The user adds a product to their basket/cart and proceeds to the checkout. They may choose to Register, Checkout as Guest or Login with an existing account.
Customer Logs in with existing account.
They get taken to a page informing them that their shopping cart is now empty. Yet in the top right the link for My Cart still reads (1 item) next to it. Clicking this link just loads the same 'Shopping Cart is Empty' page.
Some other tests I did showed the following:
User logs in, adds 3 items to his cart, but logs out before going to checkout.
He comes back to the site at a later date and starts a fresh order for just 1 product, choosing to login at checkout.
Upon doing so his cart cart displays the 3 items from his previous session (his new product missing), yet the My Cart link reads (4 items) next to it.
Does anyone know what might be causing the items to vanish from the cart during this transition from not being logged in to being logged in?
I have seen this problem before on servers that are uhosin.session.encryptrunning the suhosin patch. I'm assuming that you are running a secure cart (if not you should) what is most likely happening here is that your session is being lost each time you change between http and https.
When you switch between the HTTP and HTTPS, your HTTP session is not being passed to the HTTPS session. This can be resolved by placing the following in your .htaccess or php.ini file:
php_value suhosin.session.encrypt Off
Let me know if it works or if you are still having the same problem, remember to restart your server once you have made the changes.
I solved it.
Turns out the ZetaPrints OrderApproval module was installed and was overriding part of the checkout page.
Apparantly it was something that had been added, decided it was no longer needed and then forgotten about.
I disabled it and flushed the cache and got my old checkout page back.
All working again.
For me, it was a matter of Cooke Session Control and setting my 'Cookie domain' value as such:
.mydomain.com
Yes, with a period in front.

Resources