Skip to content

Commit 3b8eac1

Browse files
committed
CopyCart Fix v4.1.8
1 parent 7fca8e2 commit 3b8eac1

File tree

7 files changed

+57
-55
lines changed

7 files changed

+57
-55
lines changed

Components/Orders/OrderData.cs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using NBrightCore.render;
1515
using NBrightDNN;
1616
using Nevoweb.DNN.NBrightBuy.Components.Interfaces;
17-
17+
using Nevoweb.DNN.NBrightBuy.Components.Orders;
1818

1919
namespace Nevoweb.DNN.NBrightBuy.Components
2020
{
@@ -72,29 +72,6 @@ public void ConvertToCart(Boolean debugMode = false, String storageType = "Cooki
7272
}
7373
}
7474

75-
public void CopyToCart(Boolean debugMode = false, String storageType = "Cookie", string nameAppendix = "")
76-
{
77-
PurchaseTypeCode = "CART";
78-
EditMode = "R";
79-
80-
// reset order fields
81-
ShippedDate = "";
82-
TrackingCode = "";
83-
InvoiceFileExt = "";
84-
InvoiceFileName = "";
85-
InvoiceFilePath = "";
86-
PurchaseInfo.SetXmlProperty("genxml/audit","");
87-
OrderNumber = "";
88-
89-
var cartId = base.SavePurchaseData(true);
90-
91-
OrderStatus = "010";
92-
93-
var cartData = new CartData(PortalId, "", cartId.ToString("")); //create the client record (cookie)
94-
95-
cartData.Save();
96-
if (StoreSettings.Current.DebugModeFileOut) OutputDebugFile("debug_copytocart.xml");
97-
}
9875

9976
/// <summary>
10077
/// Order status
@@ -309,7 +286,7 @@ public void PaymentFail(String orderStatus = "030")
309286
//PurchaseTypeCode = "CART";
310287

311288
// make a new cart and copy the order data to it.
312-
CopyToCart();
289+
OrderFunctions.CopyToCart(this);
313290

314291
PurchaseTypeCode = "ORDER"; // Make sure this order is moved to an order.
315292
CreatedDate = DateTime.Now.ToString("O");

Components/Orders/OrderFunctions.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static String OrderAdminReOrder(HttpContext context)
120120
var orderData = new OrderData(PortalSettings.Current.PortalId, Convert.ToInt32(selecteditemid));
121121
if (orderData.UserId == UserController.Instance.GetCurrentUserInfo().UserID || NBrightBuyUtils.CheckRights())
122122
{
123-
orderData.CopyToCart(false);
123+
CopyToCart(orderData);
124124
}
125125
}
126126
return "";
@@ -133,6 +133,31 @@ private static String OrderAdminReOrder(HttpContext context)
133133
}
134134
}
135135

136+
public static CartData CopyToCart(OrderData orderdata)
137+
{
138+
var cartData = new CartData(orderdata.PortalId, "", ""); //create the client record (cookie)
139+
cartData.PurchaseInfo.XMLData = orderdata.PurchaseInfo.XMLData;
140+
cartData.EditMode = "R";
141+
142+
// reset order fields
143+
cartData.PurchaseInfo.SetXmlProperty("genxml/textbox/shippingdate", "");
144+
cartData.PurchaseInfo.SetXmlProperty("genxml/textbox/trackingcode", "");
145+
cartData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefileext", "");
146+
cartData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilename", "");
147+
cartData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilepath", "");
148+
cartData.PurchaseInfo.SetXmlProperty("genxml/audit", "");
149+
cartData.PurchaseInfo.SetXmlProperty("genxml/ordernumber", "");
150+
cartData.PurchaseInfo.SetXmlProperty("genxml/dropdownlist/orderstatus", "");
151+
152+
// Get existing, for when we copy an ORDER to a CART
153+
// QUICK FIX: So we do not change any code other than this copy funciton. (It's works!!! but yes I agree!!!)
154+
cartData._itemList = cartData.GetCartItemList();
155+
156+
cartData.Save();
157+
return cartData;
158+
}
159+
160+
136161
private static String OrderAdminEdit(HttpContext context)
137162
{
138163
try

Components/PurchaseData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class PurchaseData
2525
{
2626
private int _entryId;
2727
public NBrightInfo PurchaseInfo;
28-
private List<NBrightInfo> _itemList;
28+
public List<NBrightInfo> _itemList;
2929
private int _userId = -1;
3030

3131
public String PurchaseTypeCode;

DNNpackager.dnnpack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<root>
2-
<version>4.1.7</version>
2+
<version>4.1.8</version>
33
<websitedestrelpath>\DesktopModules\NBright\NBrightBuy</websitedestrelpath>
44
<websitedestbinrelpath>\bin</websitedestbinrelpath>
55
<!-- Include only files that match the regular expression -->

OpenStore.dnn

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<dotnetnuke type="Package" version="5.0">
22
<packages>
33

4-
<package name="OS_ProductView" type="Module" version="4.1.6">
4+
<package name="OS_ProductView" type="Module" version="4.1.8">
55
<friendlyName>OS_ProductView</friendlyName>
66
<description>
77
OpenStore open source e-commerce for DNN.
@@ -239,7 +239,7 @@
239239
</package>
240240

241241

242-
<package name="OpenStoreBO" type="Skin" version="4.1.6">
242+
<package name="OpenStoreBO" type="Skin" version="4.1.8">
243243
<friendlyName>OpenStoreBO</friendlyName>
244244
<description>
245245
OpenStore Admin Panel
@@ -285,7 +285,7 @@
285285

286286

287287

288-
<package name="OS_DisplaySearch" type="Module" version="4.1.6">
288+
<package name="OS_DisplaySearch" type="Module" version="4.1.8">
289289
<friendlyName>OS_DisplaySearch</friendlyName>
290290
<description>
291291
OpenStore open source e-commerce for DNN.
@@ -366,7 +366,7 @@
366366
</components>
367367
</package>
368368

369-
<package name="OS_AddressAdmin" type="Module" version="4.1.6">
369+
<package name="OS_AddressAdmin" type="Module" version="4.1.8">
370370
<friendlyName>OS_AddressAdmin</friendlyName>
371371
<description>OpenStore open source e-commerce for DNN.
372372
Admin for clients addresses from the front office.
@@ -441,7 +441,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
441441
</components>
442442
</package>
443443

444-
<package name="OS_Payment" type="Module" version="4.1.6">
444+
<package name="OS_Payment" type="Module" version="4.1.8">
445445
<friendlyName>OS_Payment</friendlyName>
446446
<description>OpenStore open source e-commerce for DNN.
447447
Process payment of orders.
@@ -515,7 +515,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
515515
</components>
516516
</package>
517517

518-
<package name="OS_OrderAdmin" type="Module" version="4.1.6">
518+
<package name="OS_OrderAdmin" type="Module" version="4.1.8">
519519

520520
<friendlyName>OS_OrderAdmin</friendlyName>
521521
<description>OpenStore open source e-commerce for DNN.
@@ -591,7 +591,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
591591
</components>
592592
</package>
593593

594-
<package name="OS_ProfileForm" type="Module" version="4.1.6">
594+
<package name="OS_ProfileForm" type="Module" version="4.1.8">
595595
<friendlyName>OS_ProfileForm</friendlyName>
596596
<description>OpenStore open source e-commerce for DNN.
597597
This module creates a profile form that links to the DNN profile and NBS address.
@@ -667,7 +667,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
667667
</package>
668668

669669

670-
<package name="OS_Checkout" type="Module" version="4.1.6">
670+
<package name="OS_Checkout" type="Module" version="4.1.8">
671671
<friendlyName>OS_Checkout</friendlyName>
672672
<description>OpenStore open source e-commerce for DNN. Checkout process.
673673
</description>
@@ -741,7 +741,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
741741
</components>
742742
</package>
743743

744-
<package name="OS_MiniCart" type="Module" version="4.1.6">
744+
<package name="OS_MiniCart" type="Module" version="4.1.8">
745745
<friendlyName>OS_MiniCart</friendlyName>
746746
<description>OpenStore open source e-commerce for DNN. Mini cart view.
747747
</description>
@@ -815,7 +815,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
815815
</components>
816816
</package>
817817

818-
<package name="OS_FullCart" type="Module" version="4.1.6">
818+
<package name="OS_FullCart" type="Module" version="4.1.8">
819819
<friendlyName>OS_FullCart</friendlyName>
820820
<description>OpenStore open source e-commerce for DNN. full cart view.
821821
</description>
@@ -889,7 +889,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
889889
</components>
890890
</package>
891891

892-
<package name="OS_CategoryMenu" type="Module" version="4.1.6">
892+
<package name="OS_CategoryMenu" type="Module" version="4.1.8">
893893
<friendlyName>OS_CategoryMenu</friendlyName>
894894
<description>
895895
CategoryMenu Display
@@ -961,7 +961,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
961961
</components>
962962
</package>
963963

964-
<package name="OS_ProductFilter" type="Module" version="4.1.6">
964+
<package name="OS_ProductFilter" type="Module" version="4.1.8">
965965
<friendlyName>OS_ProductFilter</friendlyName>
966966
<description>
967967
Filter module for Ajax Product Display
@@ -1034,7 +1034,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
10341034
</components>
10351035
</package>
10361036

1037-
<package name="OS_ItemList" type="Module" version="4.1.6">
1037+
<package name="OS_ItemList" type="Module" version="4.1.8">
10381038
<friendlyName>OS_ItemList</friendlyName>
10391039
<description>
10401040
Itemlist admin for shopping/favorites list

OpenStoreUpgrade.dnn

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<dotnetnuke type="Package" version="5.0">
22
<packages>
33

4-
<package name="OS_ProductView" type="Module" version="4.1.6">
4+
<package name="OS_ProductView" type="Module" version="4.1.8">
55
<friendlyName>OS_ProductView</friendlyName>
66
<description>
77
OpenStore open source e-commerce for DNN.
@@ -236,7 +236,7 @@
236236
</components>
237237
</package>
238238

239-
<package name="OS_DisplaySearch" type="Module" version="4.1.6">
239+
<package name="OS_DisplaySearch" type="Module" version="4.1.8">
240240
<friendlyName>OS_DisplaySearch</friendlyName>
241241
<description>
242242
OpenStore open source e-commerce for DNN.
@@ -317,7 +317,7 @@
317317
</components>
318318
</package>
319319

320-
<package name="OS_AddressAdmin" type="Module" version="4.1.6">
320+
<package name="OS_AddressAdmin" type="Module" version="4.1.8">
321321
<friendlyName>OS_AddressAdmin</friendlyName>
322322
<description>OpenStore open source e-commerce for DNN.
323323
Admin for clients addresses from the front office.
@@ -392,7 +392,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
392392
</components>
393393
</package>
394394

395-
<package name="OS_Payment" type="Module" version="4.1.6">
395+
<package name="OS_Payment" type="Module" version="4.1.8">
396396
<friendlyName>OS_Payment</friendlyName>
397397
<description>OpenStore open source e-commerce for DNN.
398398
Process payment of orders.
@@ -466,7 +466,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
466466
</components>
467467
</package>
468468

469-
<package name="OS_OrderAdmin" type="Module" version="4.1.6">
469+
<package name="OS_OrderAdmin" type="Module" version="4.1.8">
470470

471471
<friendlyName>OS_OrderAdmin</friendlyName>
472472
<description>OpenStore open source e-commerce for DNN.
@@ -542,7 +542,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
542542
</components>
543543
</package>
544544

545-
<package name="OS_ProfileForm" type="Module" version="4.1.6">
545+
<package name="OS_ProfileForm" type="Module" version="4.1.8">
546546
<friendlyName>OS_ProfileForm</friendlyName>
547547
<description>OpenStore open source e-commerce for DNN.
548548
This module creates a profile form that links to the DNN profile and NBS address.
@@ -618,7 +618,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
618618
</package>
619619

620620

621-
<package name="OS_Checkout" type="Module" version="4.1.6">
621+
<package name="OS_Checkout" type="Module" version="4.1.8">
622622
<friendlyName>OS_Checkout</friendlyName>
623623
<description>OpenStore open source e-commerce for DNN. Checkout process.
624624
</description>
@@ -692,7 +692,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
692692
</components>
693693
</package>
694694

695-
<package name="OS_MiniCart" type="Module" version="4.1.6">
695+
<package name="OS_MiniCart" type="Module" version="4.1.8">
696696
<friendlyName>OS_MiniCart</friendlyName>
697697
<description>OpenStore open source e-commerce for DNN. Mini cart view.
698698
</description>
@@ -766,7 +766,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
766766
</components>
767767
</package>
768768

769-
<package name="OS_FullCart" type="Module" version="4.1.6">
769+
<package name="OS_FullCart" type="Module" version="4.1.8">
770770
<friendlyName>OS_FullCart</friendlyName>
771771
<description>OpenStore open source e-commerce for DNN. full cart view.
772772
</description>
@@ -840,7 +840,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
840840
</components>
841841
</package>
842842

843-
<package name="OS_CategoryMenu" type="Module" version="4.1.6">
843+
<package name="OS_CategoryMenu" type="Module" version="4.1.8">
844844
<friendlyName>OS_CategoryMenu</friendlyName>
845845
<description>
846846
CategoryMenu Display
@@ -912,7 +912,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
912912
</components>
913913
</package>
914914

915-
<package name="OS_ProductFilter" type="Module" version="4.1.6">
915+
<package name="OS_ProductFilter" type="Module" version="4.1.8">
916916
<friendlyName>OS_ProductFilter</friendlyName>
917917
<description>
918918
Filter module for Ajax Product Display
@@ -985,7 +985,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
985985
</components>
986986
</package>
987987

988-
<package name="OS_ItemList" type="Module" version="4.1.6">
988+
<package name="OS_ItemList" type="Module" version="4.1.8">
989989
<friendlyName>OS_ItemList</friendlyName>
990990
<description>
991991
Itemlist admin for shopping/favorites list

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.1.7.0")]
36-
[assembly: AssemblyFileVersion("4.1.7.0")]
35+
[assembly: AssemblyVersion("4.1.8.0")]
36+
[assembly: AssemblyFileVersion("4.1.8.0")]

0 commit comments

Comments
 (0)