We understand that your ecommerce site is crucial to the success of your business, from time to time issues and questions can arise and you need to have the assurance there will be someone on hand to help resolve these in a timely fashion so you can spend your time driving your own business forward.

So if you are looking for faster responses to your questions or would like the assurance there is someone on hand for you to contact, fear not we have a number of paid support options that are available to you that can give your organisation the peace of mind knowing a member from the Cart Viper team will always be available to assist!

Purchase a Support Plan

Community Support

HomeHomeIssues and Supp...Issues and Supp...MiscellaneousMiscellaneousSQL Query Assistance - CVStore_OrderDetailsAttributes.valueSQL Query Assistance - CVStore_OrderDetailsAttributes.value
Previous
 
Next
New Post
9/25/2014 4:34 PM
 

Hello..

I've found the order values are stored in this table; the values are separated by commas.

Not sure if it's possible, but what I'd like to do is write a SQL query which would separate these values into their own columns.  But herein lies the issue.

Between the two products (dog tags), if it's an existing dog tag, the Owner ID is required; where-as new dog tags do not require this.

We have required fields which are the same between the two products, but there are also three columns which aren't required; rabies tag number, rabies tag expiration date and veterinarian.  So there are instances where the order will not have these values within the CVStore_OrderDetailsAttributes.value table.

Is this possible to accomplish this?  See below for examples. Thanks.. -Jeff

2014 Existing Dog Tag
* Owner ID - "18111"
* Dog Name - "Nico"
* Dog Age - Years - 10
* Dog Age - Months - 2
* Sex of Dog - Male
* Altered - No
* Dog Color - "brown/black"
* Hair - Short
* Breed - Airedale Mix - AIRX
Veterinarian - "Dr. Smith"

2014 New Dog Tag
* Dog Name - "Oliver Frazier"
* Dog Age - Years - 2
* Dog Age - Months - 8
* Sex of Dog - Male
* Altered - Yes
* Dog Color - "Yellow"
* Hair - Short
* Breed - Labrador Retriever - LAB
Rabies Tag Number - "166332"
Rabies Tag Expiration Date - "2015"
Veterinarian - "Dr. Jones"

Owner ID Dog Name Dog Age - Years Dog Age - Months Sex of Dog Altered Dog Color Hair Breed Rabies Tag Number Rabies Tag Expiration Date Veterinarian

18111 "Nico" 10 2 Male No "brown/black" Short Airedale Mix - AIRX NULL NULL "Dr. Smith"

NULL "Oliver Frazier" 2 8 Male Yes "Yellow" Short Labrador Retriever - LAB "166332" "2015" "Dr. Jones"

 
New Post
9/26/2014 8:53 PM
 

Hi Jeff

So what you are looking at there is the internal format of the variant and options which have been selected for the product that the customer has ordered.

I'm not a fan of doing too much logic and coding in SQL server, its a db query language and doesn't have enough programming features for me.
Having said that there is a much easier way to do what you want. In Cart Viper you can define a class which gets executed when an item is purchased. I would use this feature to write a custom assembly which contains the C# code to extract the data in the variant attribute for the order details and then push this into the custom table you have.

You can use regex for example to work out the field boundaries and determine if the item is a new order or a renewal.

To make write the code you need to create a class which implements this interface

CartViper.Modules.Store.Cart.PaymentCompleted.IPaymentCompletedHandler which is in the assembly CartViper.Modules.Store.dll

Once you have the dll created you then need to register the setting in a table in the database.
Please add your own two part type and assembly name to this statement to register the class. ( 'myclass.handler.ordercomplete.classname,assemblyname', these need to be changed to the correct values for your class and assm name)

Once you have executed the SQL statement you then need to clear the cache in DNN.

declare @portalId int

set @portalId = 0

if not exists(select null from {databaseOwner}[{objectQualifier}CVStore_StoreAttributes] where parentId = @portalId and name = 'CV_STORE_PAYMENT_COMPLETED_TYPE')

begin

insert into {databaseOwner}[{objectQualifier}CVStore_StoreAttributes]

(parentId,name,value) values(@portalId, 'CV_STORE_PAYMENT_COMPLETED_TYPE', 'myclass.handler.ordercomplete.classname,assemblyname')

end

We would be happy to quote for creating a solution around this idea if you would prefer us to do it. Please email me mark@cartviper.com 

Regards

Mark

 
Previous
 
Next
HomeHomeIssues and Supp...Issues and Supp...MiscellaneousMiscellaneousSQL Query Assistance - CVStore_OrderDetailsAttributes.valueSQL Query Assistance - CVStore_OrderDetailsAttributes.value


 

We use cookies on our website to improve our service to you, by continuing you agree to our use of cookies. However you are able to update your settings at any time.

Cookie Policy

A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a piece of data stored by a website within a browser, and then subsequently sent back to the same website by the browser. Cookies were designed to be a reliable mechanism for websites to remember things that a browser had done there in the past, which can include having clicked particular buttons, logging in, or having read pages on that site months or years ago.

Strictly Necessary Cookies

These cookies cannot be disabled

These cookies are necessary for the website to function and cannot be switched off. They are normally set in response to your interactions on the website e.g. logging in etc.

Cookies:
  • .ASPXANONYMOUS
  • .DOTNETNUKE
  • __RequestVerificationToken
  • authentication
  • CV_Portal
  • CV_Store_Portal_Cart_0
  • CV_USER
  • dnn_IsMobile
  • language
  • LastPageId
  • NADevGDPRCookieConsent_portal_0
  • userBrowsingCookie

Performance Cookies

These cookies allow us to monitor traffic to our website so we can improve the performance and content of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited or how you navigated around our website.

Cookies:
  • _ga
  • _gat
  • _gid

Functional Cookies

These cookies enable the website to provide enhanced functionality and content. They may be set by the website or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Targeting Cookies

These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Feedback