• Welcome to KonaKart Community Forum. Please login or sign up.
 
April 20, 2024, 04:05:27 am

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Ted

1
Configuration of KonaKart / Specials query
November 30, 2009, 12:32:26 pm
Hi,

Every now and then (when ofcourse logging is set to log this) I see a query like:


SELECT specials.specials_new_products_price, specials.status, specials.expires_date, products_to_categories.categories_id, products.products_date_added, products.products_date_available, products.products_id, products.products_image, products.products_image2, products.products_image3, products.products_image4, products.products_model, products.products_price, products.products_price_1, products.products_price_2, products.products_price_3, products.products_ordered, products.products_quantity, products.products_status, products.products_invisible, products.products_weight, products.products_tax_class_id, products.products_sku, products.products_type, products.products_file_path, products.products_content_type, products.custom1, products.custom2, products.custom3, products.custom4, products.custom5, products.store_id, products.max_download_days, products.max_num_downloads, products.stock_reorder_level, products.can_order_when_not_in_stock, manufacturers.manufacturers_name, manufacturers.manufacturers_id, products_description.products_name, products_description.products_url, products_description.products_viewed, kk_product_to_stores.price_id, products_description.products_description, products_description.products_comparison FROM products LEFT JOIN specials ON products.products_id=specials.products_id LEFT JOIN products_to_categories ON products.products_id=products_to_categories.products_id LEFT JOIN manufacturers ON products.manufacturers_id=manufacturers.manufacturers_id, products_description, kk_product_to_stores WHERE products.products_id=products_description.products_id AND products.products_id=kk_product_to_stores.products_id AND products_description.language_id=1 AND kk_product_to_stores.store_id='SAV' AND products_to_categories.store_id='SAV' AND products.products_id=30593


I can't really pinpoint what part of the code is causing this. Is there a way to disable this? (By the way we're using KkAppEng in our own Wicket app).
2
Programming of KonaKart / Too much options possible
November 20, 2009, 10:56:01 am
Too much options possible?

Create a lot of product attributes in KonaKart. The products_quantity table has a products_options column which gets filled with values like 69159{70562}69172{70814}. These are the ids of the product options belong to a product.

The products_options column is of type VARCHAR(128). This means that the length of these strings inserted in this column (which may have lengthy id's of product_options) may exceed 128 chars at a point if one were to have lots of product options. We had to resize this column to accomodate our needs, but this doesn't scale well for huge systems I think. I suggest to size up this column in a next release?
3
Hi!

We're trying to achieve in the future to serve a e.g. 20 stores in our multi-store engine mode 2 (products and customers shared) with each a different price for a single product.

By the way it seems implemented there's the main price of a product ("Price Ex Tax") and 3 additional prices ("Price1 Ex Tax, Price2 Ex Tax, Price3 Ex Tax") on the Details tab in konakartadmin. To achieve a different price for a store in the Stores tab for each store with a number (0-3) one of the earlier mentioned prices can be designated for that store.

Would that in essence limit the amount of stores we can have with a different price (in products/customers-shared mode) to 4? There are only 4 hard-wired price fields per product and when set - they differ in behaviour* compared to using the default price.

If that's the case, storing prices in seperate join-table (such as 'products_to_categories' to link products to categories per shop) wouldn't have resulted in more flexibility?

* the documentation states: "If the price Id is set to 0-3, then price 0 to price 3 are used, regardless of the customer group."
4
Configuration of KonaKart / Address Formats fields
November 10, 2009, 01:36:06 pm
When adjusting the fields in the default address format we have, what possible field values are there?

E.g. when using '$firstname $lastname$cr$streets $suburb$cr$postcode $city$cr$country' it seems that $suburb isn't correctly substituted when viewing the customers address e.g. on a packaging slip of an order he made. It's just '$suburb'. Is there a list of fields I can use?

I also read custom fields are not used by the address formatter. Is this still true? I heard earlier a minor patch to AddressInfo would solve the trick?
5
Programming of KonaKart / Quick-signup Newsletter
November 10, 2009, 10:29:54 am
Hi!

We're looking for a way to have a quick-signup for he newsletter, needing only a full name and a emailaddress for someone who wants to sign up. However, it looks like you need to register a full valid customer (with all address and all and most imporant - a password) in order to manage it as a subscriber. We could however (only having full name and emailaddress) generate default values for every mandatory field (I've read there are a lot of not-null fields as a result to remain backwards compatible with osCommerce) - but then we think we run into problems when that customer actually tried to register sometime as a new user - its emailaddress will already be taken in mode 2.

Is there anyone who has experience with subscribing to a newsletter in KonaKart without having to have all details for a complete new registration?
6
Programming of KonaKart / Special price per shop
November 05, 2009, 01:40:49 pm
Hi!

It seems that the special price of a product goes for all shops when products/customers are shared. Is there a way to have this special price differ for stores in mode 2?

Regards, Ted
7
Programming of KonaKart / Mocking and testing KonaKart
November 05, 2009, 10:46:41 am
Since I'm not using the Struts/JSP application delivered with Konakart I have to test several interactions from Wicket with the KonaKart API by means of JUnit and e.g. Easymock.

Now I was wondering: konakart.properties allows to change the default manager classes for something other. Can I do this programmatically during tests?

In konakart.properties I want to leave e.g.

#konakart.manager.CustomerMgr = com.konakart.bl.CustomerMgr

in place, but is there a way to set another class (adhering to CustomerMgrIf ?) to use as customer manager?

E.g. in my own code


public void storeUser(CustomerIf customer) throws KKException{
appEng.getCustomerMgr().editCustomer(customer);
}


I'd like to have 'getCustomerMgr()' return my own customer manager if my test requires that. I'd rather not adjust konakart.properties for that if I can avoid that. Setting custom managers as each test requires would have my preference.
8
Just a quick question: it is possible (by e.g. the API) to have a status set on a product-by-product basis inside an order?

E.g. the full order (with 3 products) has state PARTIALLY_DELIVERED, because
product 1 is DELIVERED
product 2 is DELIVERED
product 3 is PARTIALLY_DELIVERED

Looking at the API it seems only the complete order itself has a status and not individual products in it, right?
9
Via the client API it seems that when searching for a custom field (dataDescriptor.customX) the search only matches on exact values. Is there as way to specify partial matches too?
10
Programming of KonaKart / Search for review / rating
November 03, 2009, 10:39:59 am
Is it possible to search for products which have been rated for a certain value? E.g. give me all products with a minimal rating of 3 stars?
11
Programming of KonaKart / Order not saved
October 29, 2009, 02:56:07 pm
In my Wicket application I have used a great deal of the shopping cart code of the Struts/JSP application.

Now I've taken some of the code from CheckoutConfirmationSubmitAction.java to save the order en get the payment details at the end of the checkout process:


// Save the order
int orderId = kkAppEng.getOrderMgr().saveOrder(/* sendEmail */false);
log.debug("Order succesfully saved as order id " + orderId);

OrderIf dbOrder = kkAppEng.getEng().getOrder(kkAppEng.getSessionId(), orderId, -1);
log.debug("From db: " + dbOrder);

// Get a fully populated PaymentDetails object and attach it to the order
log.debug("Retrieving payment details with sessionId=" + kkAppEng.getSessionId()
+ ", code=" + checkoutOrder.getPaymentDetails().getCode()
+ ", orderId=" + orderId + ", hostAndPort=" + hostAndPort + ", langId="
+ kkAppEng.getLangId());
PaymentDetailsIf pd = kkAppEng.getEng().getPaymentDetails(kkAppEng.getSessionId(),
checkoutOrder.getPaymentDetails().getCode(), orderId, hostAndPort,
kkAppEng.getLangId());
checkoutOrder.setPaymentDetails(pd);


Note that I have added some debug statements myself. This is because I'm getting an exception the following exception:


DEBUG CheckoutPayment - Order succesfully saved as order id 5
DEBUG CheckoutPayment - From db: null
DEBUG CheckoutPayment - Retrieving payment details with sessionId=196bd4150d08942f9b2b6ee9d72a9465, code=<mycode>, orderId=5, hostAndPort=<myshop.com>:8080, langId=1
ERROR CheckoutPayment - Oops.
com.konakart.app.KKException: Cannot find order for Id = 5
at com.konakart.bl.modules.payment.PaymentMgr.getPaymentDetails(Unknown Source)
at com.konakart.app.KKEng.getPaymentDetails(Unknown Source)
at com.konakart.app.KKEng.getPaymentDetails(Unknown Source)
at <somepackage>.CheckoutPayment.process(CheckoutPayment.java:183)


at com.konakart.bl.modules.payment.PaymentMgr.getPaymentDetails()

Except for the log statements every API call is the same in the correct sequence. May be it has something to do with my current user or something I forgot to do before this point, but I can't debug the fact that the order which is supposed to be saved (I'm getting a id) isn't saved - calling kkAppEng.getEng().getOrder(...) results in null and in the database indeed actually nothing shows up.

Any hints to look for would be appreciated!
12
See screenshot. I thought when products are shared, customer have to be shared too?
13
Configuration of KonaKart / Addresses
October 28, 2009, 08:48:16 am
I 've got a question about addresses in KonaKart.

- Although the Struts/JSP app says a customer can't create more than 5, is this actually enforced by the KonaKart API or is this in the Struts/JSP frontend code? Else I would recommended this as a feature for the future.
- Looks like there are a number of addresses to be associated with a customer but only 1 can be set as primary address?
- Is there a way to have a customer while managing his addresses upfront (in My Account) designate addresses for delivery specifically and others for shipping? Or is this something only during checkout can be managed?

We're not using the KonaKart Struts frontend - so I'm especially interested in anything that goes directly via the API.
14
We're mimicking the Struts/JSP logic of the KonaKart frontend in our own Wicket frontend by using KKAppEng for most purposes.

We have customers and products shared in Multi-Store Single DB Mode and developing currently to support multiple stores. Now since customers are shared (and can use their account created at store 1 to log into store 2) it's essential for commercial purposes that we track at what shop a customer is registered as a new user initially.

Can this be configured? If not, any suggestions as to what approach can be taken best will be greatly appreciated.
15
Configuration of KonaKart / Recalculating tax back?
October 27, 2009, 08:03:27 am
We're developing a Wicket frontend which basically uses the same KonaKart API calls on similar screens as in the Struts/JSP frontend application.

Now, our KonaKart products are updated/modified/deleted during from a main repository on a daily basis. The prices INCLUDING tax are calculated externally since they're rounded to nice numbers for commercial purposes e.g. "$ 9.95". Our solution was to import that price as the main price (9.9500) for a product in the products.products_price table.

Now we have defined a country with an associated Tax Area and an associated Tax Rate of 19%. With all the options in the KonaKart admin configuration (such as enabling to display prices including or excluding tax etc.) we don't know if its possible to achieve the following: calculate back the original EXCL. tax price preferably in the list if the order totals (on the cart screen). So basically the opposite of using an excl. tax price and adding the tax. E.g.

Product
======
1 x Some product: $ 9.95

Order totals
======
Excl. tax: $ 8.36
Tax 19%: $ 1.59
Shipping: ...
Total: $ 9.95

So, is there a configuration to use the original stored price INC. tax, and calculate back the EXCl. tax price, show it and show the tax?
16
Programming of KonaKart / Referential constraints
October 27, 2009, 07:37:43 am
I've noticed that the MySQL database schema sql (konakart_demo.sql) doesn't have any foreign keys in its tables. Is this by design? Right now, it seems I manually would be able to delete a product (without using the KonaKart API) and everything pointing to its product id would be left orphan in the database?
17
I've started on a project we're we have to integrate an entirely new Wicket application with KonaKart. Although the KonaKart Struts/JSP frontend application gives us a lot of information as to how to interact with the client engine KKAppEng, there are a few constructions I'm not entire confident about.

We have taken the following resources from the KonaKart distribution and added them inside our Wicket Maven application:

  • in WEB-INF/lib: konakart.jar, konakart_app.jar, konakart_custom.jar, konakart_utils.jar, konakart_village-2.0.jar

  • in src/main/resources: konakart.properties and konakart_app.properties

  • the rest is bascially good ol' MySQL 5 filled with the konakart_demo.sql and the correct JDBC driver




The first problem: How to create KKAppEng? (Does KKEngPlugin know more?)

Basically I have inside my Wicket application a HomePage which extends TemplatePage - this I tried to mimick from the Struts/JSP frontend classes CatalogMainPageAction and it's parent BaseAction. But when I have only the BaseAction code in place, e.g.:

            String storeId = getStoreIdFromRequest(request);

            StoreInfo si = new StoreInfo();
            si.setStoreId(storeId);
            kkAppEng = new KKAppEng(si);


I get this NullPointerException in com.konakart.al.KKAppEng.getEngConfCopy:

Caused by: com.konakart.al.KKAppException: java.lang.NullPointerException
at com.konakart.al.KKAppEng.init(Unknown Source)
at com.konakart.al.KKAppEng.<init>(Unknown Source)
at somepackage.wicket.ui.TemplatePage.getAppEng(TemplatePage.java:195)
at somepackage.wicket.ui.HomePage.<init>(HomePage.java:40)
... 33 more
Caused by: java.lang.NullPointerException
at com.konakart.al.KKAppEng.getEngConfCopy(Unknown Source)
at com.konakart.al.KKAppEng.getAServerEngineInstance(Unknown Source)


So my solution was the invoke the other constructor first:

EngineConfig engConf = new EngineConfig();
try {
engConf.setPropertiesFileName("konakart.properties");
engConf.setAppPropertiesFileName("konakart_app.properties");
engConf.setMode(engineMode);
engConf.setStoreId(storeId);
engConf.setCustomersShared(customersShared);
engConf.setProductsShared(productsShared);

// override store id with one from request if any
String requestStoreId = getStoreIdFromRequest(request);
if (requestStoreId != null) {
engConf.setStoreId(requestStoreId);
}

// this sets e.g. property file internally...
appEng = new KKAppEng(engConf);
} catch (Exception e) {
throw new RuntimeException("Unable to instantiate EngConf.", e);
}

// ..and now we have to use the KKAppEng(StoreInfo storeInfo) for
// when a user creates a new session.
StoreInfo si = new StoreInfo();
si.setStoreId(engConf.getStoreId()); // we have default store or request store
appEng = new KKAppEng(si);


Now everything works fine - but ofcourse this setup seems weird: having to call 2 constructors to properly initialize everything. In Struts a mysterious com.konakart.plugins.KKEngPlugin seems to would have called the KKAppEng(com.konakart.appif.EngineConfigIf engConf) constructor first when the container loaded. Now we have to do that ourselves so it seems. Is this true? It looks like there's no source of KKEngPlugin so there's noway to see what that class does in order to do it manually.

Also, I'm not sure whether or not properties from konakart.properties override any set properties via the setters e.g. engConf.setMode(engineMode) this way.

Next: Why can 't I retrieve any categories?

Now that I don't get any exceptions anymore I started out to get the categories for a block on the homepage, but I'm not getting any results from the CategoryMgr. It also seems that I had to log in myself as one of the example users - but I didn't see such code in the STruts/JSP application source so somehow something is playing tricks with me :D

CategoriesPanel is supposed to list the categories, buit it doesn't. (I've passed the KKApEng created earlier to the constructor for this component and is being used as a protected variable "appEng").

appEng.getCustomerMgr().logout();
String sessionId1 = appEng.getEng().login("root@localhost", "password");
String sessionId2 = appEng.getCustomerMgr().login("root@localhost", "password");
log.debug("sessionId1: " + sessionId1);
log.debug("sessionId2: " + sessionId2);
log.debug("appEng.getSessionId(): " + appEng.getSessionId());
log.debug("appEng.getCustomerMgr().getCurrentCustomer(): " + appEng.getCustomerMgr().getCurrentCustomer());
log.debug("appEng.getCategoryMgr().isMgrReady(): " + appEng.getCategoryMgr().isMgrReady());
log.debug("appEng.getCategoryMgr().getCats(): " + appEng.getCategoryMgr().getCats());
log.debug("appEng.getCategoryMgr().getCurrentCat().getName(): " + appEng.getCategoryMgr().getCurrentCat().getName());

results in

[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - sessionId1: 194a5dd2e2a708b20d63a8bfc93a40ed
[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - sessionId2: b99b0cf470e757410220e29d768cf3ac
[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - appEng.getSessionId(): b99b0cf470e757410220e29d768cf3ac
[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - appEng.getCustomerMgr().getCurrentCustomer(): Customer:
accountCreated = null
accountLastModified = null
birthdate = Mon Jan 01 00:00:00 CET 2001
emailAddr = root@localhost
faxNumber =
firstName = John
gender = m
globalProdNotifier = 0
id = 1
lastName = doe
lastLogon = null
newsletter = 0
numberOfLogons = 0
password = null
globalProdNotifier = 0
telephoneNumber = 12345
type = 0
groupId = -1
custom1 = null
custom2 = null
custom3 = null
custom4 = null
custom5 = null

[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - appEng.getCategoryMgr().isMgrReady(): false
[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - appEng.getCategoryMgr().getCats(): null
[2009-10-12 14:21:07,125] DEBUG somepackage.wicket.ui.tiles.CategoriesPanel - appEng.getCategoryMgr().getCurrentCat().getName():


There are no categories returned. I've checked the database they're all there. Further more I'm trying to rewrite some of the Struts methods (using HttpServletRequest) to Wicket methods (using Wicket's own Request object). My being new to integrations with KonaKart - and even more so since I don't use the existing Struts/JSP frontend - I realize there are a few subtleties I think I'm not aware of.

A few questions:

Can information such as categories be retrieved from the KonaKart client API anonymously or do I always need to be logged in as someone?

What's the difference between

  • KKAppEng's getEng().login(username, password)

  • KKAppEng's getCustomerMgr().login(username, password)



Why does getCategoryMgr().isMgrReady() say false? Is this relevant for my problem (= not getting anything) and if so, how can I ascertain the cause?

There are a few Struts methods, such as manageCookieLogout(request, response, kkAppEng), which manipulate the HttpServletRequest and HttpServletResponse. For Wicket I've rewritten them to use it's own wrappers for that (org.apache.wicket.Request and org.apache.wicket.Response) because that's simply good practice - but I'm wondering if the client engine implicitly is expecting session attributes which I don't set anymore (because of some rewriting).

If someone (with or without specific Wicket knowledge) can give me any pointers, they would be greatly appreciated!!