Find Jobs
Hire Freelancers

Change a Wordpress Ecommerce plugin to store each cart in a DATABASE rather than SESSIONS

$30-100 USD

已取消
已发布超过 12 年前

$30-100 USD

货到付款
I'm very busy, and need help on a few tasks. The most important task I need help with is regarding this LGPL licensed Wordpress ecommerce plugin: <[login to view URL]> It uses SESSIONS to store information in the shopping cart. For example, if a person Adds To Cart a shoe, the data for the items that are in the cart is stored using SESSIONS. I need the new code to be 100% backwards compatible, as in, the only thing I want to change is the dependancy on SESSIONS. I want to eliminate this dependance and simply store the cart data in a database entry, and use a COOKIE to store the key to that database entry. Here's the PHP source code that comprises the cart: <[login to view URL]> You can alter this file, or any other wpStoreCart file as much as needed in order to transition to a COOKIE/DATABASE version of the cart, in place of the old SESSIONS method. ## Deliverables Line 62 of [login to view URL] is: $wpsc_cart_type = 'session'; You can change this to something new like: $wpsc_cart_type = 'database'; Then, anywhere you see the cart initialized using sessions, like this: if($wpsc_cart_type == 'session') { if(!isset($_SESSION)) { @session_start(); } if(@!is_object($cart)) { $cart =& $_SESSION['wpsc']; if(@!is_object($cart)) { $cart = new wpsc(); } } } You can add code below it such as: if($wpsc_cart_type == 'database') { // Your code goes here } You can also use $wpsc_cart_type inside the cart itself. Remember, we need the cart to work exactly the way it does already, except we need it to not use SESSIONS at all, and instead, save the state of the cart to the database, and then restore that state on every page load. That's it. That's all this project requires. But the important thing is that everything remains functional after the switch. You may be able to utilize PHP serialize() and unserialize() function, in combination with a COOKIE which will store the primary key of the current users cart database entry. You may need to use the magic methods __sleep() and __wakeup() to properly store the cart. If you're trying out the cart and cannot get it to store items in the cart after you switch to another page, then you're probably effected by this bug: <[login to view URL]> ^ That is the reason why we need to move to a database/cookie solution! wpStoreCart's shopping cart was built from a fork of jCart. These jCart forum threads may help you in this matter: <[login to view URL]> <[login to view URL]> Thanks for looking. If you feel you can do this, please bid! Please, if you're serious about bidding, prove to me you read this by copying and pasting the following into your bid: "I read the entire job description"
项目 ID: 3569484

关于此项目

1条提案
远程项目
活跃13 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
1威客以均价$200 USD来参与此工作竞标
用户头像
See private message.
$200 USD 在14天之内
5.0 (8条评论)
3.4
3.4

关于客户

的国旗
5.0
8
会员自3月 16, 2011起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。