Cart items missing after login, drupal6 with ubercart - drupal-6

I using drupal 6 and ubercart latest version for my shopping site.
Unfortunately the selected items missing from the cart after login. Message showing "There are no products in your shopping cart".
Homepage : our products -> Buy now -> checkout -> login -> result in cart page = 'There are no products in your shopping cart.'
I have tried out some more fixes, But its not working for me.
For ref : http://www.ayurvedaonlineshopping.com
Thanks in advance for spent your precious time.

Related

How to Get Cart Data in NetSuite SiteBuilder Application

I am new in NetSuite Development.
I want to fetch list of product which are added in the cart to show Short Summary in Header Section. Like Item thumbnail, qty, and price.
Can anyone help me how to do this, or what I need to read to accomplish this task.
Any Help will be appreciated.
Thanks.
Probably the easiest thing to do is create an SSP application and pull the cart as a JSON object from a cart.ss url.
I know the old reference checkout had a /services/cart.ss file that could be used for this (free bundle from Netsuite)
You may be able to get away with a really simple script for that:
/ssp root url/services/cart.ss
service(request, response){
var session = nlapiGetWebContainer().getShoppingSession();
var orderObj = session.getOrder();
response.setContentType('JSON');
response.writeLine(JSON.stringify({order: orderObj.getFieldValues()}));
}
Then when you've published the SSP application you'd access this as an root relative url from the site.

How to create a referral link in nodejs

Am trying to figure out a way of creating a unique referral link that directs to my site for each user that signs up for my site, but to be sincere i don't really know how it works out for sure, I have tried googling for it, but i can't find a perfect answer for it, any plugin needed or any way around that.
The user model, no much code i don't have any idea of this
var UserSchema = new mongoose.Schema({
username: String,
password: String,
referralLink: String
})
UserSchema.plugin(passortLocalMongoose);
module.exports = mongoose.model("User", UserSchema )
user sign up
router.post("/register", function(req,res){
var newUser = new User({username: req.body.username,referral: req.body.referral});
User.register(newUser, req.body.password, function(error, user){
if(error){
console.log(error)
req.flash("signerror", error.message)
return res.redirect("/register")
}
//Do the referral link creation stuff here, don't know for sure
})
})
if there is a way for this, would be glad if you help out
How to create a referral link?
Let this be a platform/language agnostic how-to:
Every time new User is created, generate unique link for him to be his unique referral link and store it in DB (For simplicity this could be _id which is unique in MongoDB and is auto-generated - in this case you don't have to create another field). Let's also keep count of how many people registered through this person's link, let it be referredCount.
Referral link could look for example like this: /register?referrer=${_id}, where ${_id} is user unique ID.
Send referral link to user, so he can pass it along to other people, or make it visible in his /account page - obvious step
When someone registers via this link, create new User as usual and after succesful creation, get req.query.referrer from the URL, look into DB for user with this particular ID and increase his referredCount.
Note that it's just a way of doing that, I'm sure there might be many different strategies for it.
I suggest that you create a table/collection for referrals.
Schema could contain:
userId (the user who generated the link)
numberOfUses (the number of times the link can be used)
expires at (incase you want to limit the validity to a specific period)
MongoDB will generate a _id aka referralId
You can modify the registration endpoint to accept an optional param referralId
Whenever someone uses a referal you just get the userId of the person who created the invite link.
To address Your question from the comment:
You can follow #Tomasz suggestion however to keep referral link You can use cookies.
A cookie is a small piece of data which is stored in a user’s web browser when they visit a website. When a customer comes to your website via an affiliate referral link (i.e. yoursite.com/?ref=123), application should store two main browser cookies in order to track the referring affiliate, and the visit. Their names are:
aff_ref - this cookie stores the affiliate's unique ID
aff_ref_visit_id - this cookie stores the visit ID (the visit ID increments by 1, each time any referral link is used until the cookie expires or is deleted).
So You are able to detect if user came to website using referral link by checking the cookie. It is worth to mention that
cookies should remain in the browser throughout the purchase or conversion process to track the correct affiliate so a referral can be generated for that affiliate. The cookies should also remain in the customer's browser for a period of time specified by the site admin or until the customer clears their cookies.
in the user schema .. have a field named referral (either be a name, number or takes another user's Id ) ...on the main site. create a button that will generate a user's personal referral link (using Javascript) so that the link will look like "your-domain.com/register?register=${user._id} ... then on the registration page ... there will be an hidden input field ... which will automatically be field with the query param ...
location.search so that when a user register ... the person that referred them will also be registerd ... then the route will be like
app.post('/register',(req,res) =>{
user.update({id:(req.query.register)},{referral:req.body.name})
...remaining registration routing ...
})

Best approach to moderate posts in express nodejs mongodb

I am building a project in NodeJS, Mongodb, ExpressJS and at this time I would like to be able to moderate each post someone posts and therefore I am kindly asking what would best approach be to do so ?
I would have some users as Moderators and they would need to approve/moderate each post before the post is being released for public.
The same post could be seen only by the post creator during the time it's under review.
What would the best approach be to do something like this ?
Thnx in advance
Create post schema in mongoose
Keep a field in the schema, say
curated: {
type: Boolean,
default: false
}
This field would determine whether a post is curated and should be visible to the public, or not
Initially, curated = false
Create a front-end panel for the moderators to view the posts.
While querying in the MongoDB for the list of posts to be shown,
add appropriate filter, so that the post is visible only if the user is the creator of post or if his role is, let's say "moderator"
req.user is the current user.
Let's say req.user = {roles:["user", "moderator", "admin"]};
if(req.user.roles.indexOf("moderator")>-1){
db.getCollection("posts").find({user: req.user})
}
This will only return posts which have been created by the current user, or if the current user is a moderator
Now the user can choose to change post.curated to true, and update the post
Now, while fetching for the list of posts to be visible to public, add filter
db.getCollection("posts").find({curated:true})

MVC Payment provider

After two week I will publish my website on productions.Web site is a e commerce.I have two way of payments:
Pay pal
Pay on delivery
I want to make 3th payment method that looks like this one.
My question is : Is there a come kind of web api or providder that give me to redirct on payment procces like picture where users is redirect and can secure fills theirs data.My project is on MVC !
You need to create 3 partialViews and 3 viewModels for each payment method. Then set required attribute to your viewModel's properties.
[Required("CreditCard_Field_Required_Error")]
[StringLength(16)]
public string CreditCardNumber { get; set; }
And check which model and view is filled on button click with jquery.
The other way is post your data with Ajax.ActionLink and get the result of view which you send to related controller.
#Ajax.ActionLink("menu list",
"GetCardResultInfo",
new AjaxOptions{
InsertionMode=InsertionMode.Replace,
UpdateTargetId="CardPayment",
HttpMethod="GET",
})
<div id="CardPayment"></div>

Log out NetSuite

I'm trying to create a Log out link in NetSuite I know that the code below works but when i place it in netsuite it just gets outputted as text. I'm just having trouble understanding where in NetSuite it actually goes. It does not work when I place it in a template.
<# var isLoggedIn = "<%=getCurrentAttribute('customer','email')%>" != ""; if(isLoggedIn) { <li class="dropdown-menu1"> Log out </li> } #>
isLoggedIn has been replaced with isLoggedIn2 FYI, or at least for the company that I work for this was the case and recommendation
You might:
A) Replicate the scripts called when you log out
B) Clear cookies and redirect to X page.
'isLoggedIn' method is no longer supported or recommended. This method works correctly in the Checkout domain but may return false when used in the Shopping domain even when the user is logged in. The method is currently being use in pre_Denali versions of SuiteCommerce Advanced. If you encounter session issues in those bundles, contact support to migrate to using the isLoggedIn2() method.
-- posted today on NetSuite's forum by an employee

Resources