zend framework - zend_session goes wrong after get the second product -


im a launcher. And when I was roaming with zend_session I had a problem like this.

Everything works fine with one item but more than one item stops adding more items or enhances the mail account.

Here is my code

  // $$$$ intQuantity = $ it-> Get value from & gt; _request-> GetPost ('intensity'); $ IntSize = $ this- & gt; _request-> GetPost ('intSize'); $ IntProductId = $ this-> _request-> GetParam ('productId'); // Call Model Cart $ cart model = new Default_Model_cart (); // input value matched in function value matched row / * * array * (* [0] = & gt; array * (* [product_id] => 7 * [product_price] => 1600000 * [product_image_url_50] Itam Output Array = & gt; 50_nike-janoski-new-1363618892.jpg * [product_size_title] => 6.5 *) *) * * * * / $ cartArrays = $ cartModel- & gt; Idea Itam ($ intProductId, $ intQuantity, $ intSize); // Add quantity in the cart. Array / * * array * (* [0] = & gt; Hey * (* [product_id] = & gt; 7 * [product_price] => 1600000 * [product_image_url_50] => 50_nike-janoski-new - 1363618892.jpg * [product_size_title] => 6.5 * [quantity] => 1 *) *) * * * * / $ cartrage [0] ['quantity'] = $ intensity; // session session $ session = new Zend_Session_ namespace (); / * * True sessions- & gt; The product must have at least one orange cartare * * / if (presenter ($ session-> product)) {$ i = 0; Foreign derivative arrays in array foreach ($ session-> product $ $ product - as a session and date) / if any array contains product ID and product_service_chatel matching cartridge product ID and product_save_chitel * $ intQuantity to appropriate $ session- & gt; $ I * / $ ($ productSessionArray ['product_id'] == $ CartArrayase [0] ['product_id'] and $ productive session ['product_size_title'] == $ cartrage [0] ['product_size_title']) { $ Session- & gt; Product [$ i] ['quantity'] + = $ intensity; / * * If the price does not match then $ session- & gt; Add a whole new array of products * * /} and {$ productSessionArrays [] = $ productSessionArray; $ ProductSourceArray [] = $ CartArrayase [0]; $ Session- & gt; Product = $ error in product session; } // $ 1 $ i ++ increases; } // If there is no array in $ session then the array is added in it} and {$ session-> Product = $ cartArere; }    

It seems that you are only testing the ID of the first cart item : $ ($ ProductSessionArray ['product_id'] == $ CartArrayz [0] ['product_id'] and $ productive session ['product_sy_chitel'] == $ cartrage [0] ['product_size_title'])

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -