API helper class for CS-Cart 4 - FREE

Hello friends… I am a newbie in cs cart. anyone can tell me how to override the template file…

I want to override orders/details.tpl in another addon.



Thank you…! :-)

[quote name=‘ankushchaudhari’ timestamp=‘1436192918’ post=‘221787’]

Hello friends… I am a newbie in cs cart. anyone can tell me how to override the template file…

I want to override orders/details.tpl in another addon.



Thank you…! :-)

[/quote]



There is a separate section in Docs “How to override a template”: TPL Hooks — CS-Cart 4.0.x documentation

Here is an extra link:

php - How to use hooks in CS-Cart for overriding variant_item.tpl - Stack Overflow

[quote name=‘ankushchaudhari’ timestamp=‘1436192918’ post=‘221787’]

Hello friends… I am a newbie in cs cart. anyone can tell me how to override the template file…

I want to override orders/details.tpl in another addon.



Thank you…! :-)

[/quote]



For admin panel please use:



design/backend/templates/addons/YOUR_ADDON/overrides/views/orders/details.tpl



For store-front please use:



design/themes/YOUR_THEME/templates/addons/YOUR_ADDON/overrides/views/orders/details.tpl

Hi, i'm trying ti update tracking number by sending a request to http://host/api/shipments/1 via PUT request. I can receive a shipment data via GET request so id is correct.

My test data is {“carrier”:“FEDEX”,“tracking_number”:“111”}

But I received an error: {“message”:“Bad Request: Only the tracking_number and carrier params can be updated with the setting 'Allow multiple shipments for a single order' set”,“status”:400}



What i'm doing wrong?

Looks like a bug in the app\Tygh\Api\Entities\Shipments.php file due to the following code:



if (Settings::instance()->getValue('use_shipments', '', $order_info['company_id']) == 'Y') {
$data['message'] = __('api_shipments_not_allow_update');
$valid_params = false;
}




The system checks value of the setting, but does not check input parameters.



Please contact CS-Cart support team.

i read this http://doc.prestashop.com/display/PS14/Using+the+REST+webserviceand there are some prepared tools...

hope this prepared solutions will be found in the future directly on cs cart api page

Hi there,

In the past few months, I left my API wrapper project alone :(

Yesterday I made some changes regarding bug reports, and released the first "official" release with version number 1.0.0

You can find the latest version of this wrapper class here: https://github.com/drahosistvan/cscartapi

I'm using this tool for a lot of projects, and I realized, that this class is helpful, but it would be good if I will be able to install the package via Composer, and I'm working on a version which has a lot of helpful methods, and a beautiful API.

If you think it is a good idea, please share your ideas here.

Enhancements for version 2.0.x

- Composer compatibility

- New API (eg. CSCart::Products()->whereStatus('A')->get()->toArray()) which is similar to Laravel's Eloquent API

- Service provider for Laravel (I use this API in Laravel projects a lot)

- New HTTP Client version (you will have the option to use streamclient instead of curlclient)

How can i create a new category with this tool?

How can i create a new category with this tool?

You can check the official API documentation here:

http://docs.cs-cart.com/4.3.x/developer_guide/api/entities/categories.html

If you create a POST request to "/categories", it will create a new entry for you.

For more information about this tool, please check the readme file here: https://github.com/drahosistvan/cscartapi

Hello, you can directly in the home page (index.tpl) call Banner and blog data Can no one help me?

Happy to if I could understand your question.

Hello, you can directly in the home page (index.tpl) call Banner and blog data Can no one help me?

stick to the topic perhaps???

Hello.

Good work. Very useful tool.

Phillip

Is anyone else seeing an issue where API calls trigger the CS-Cart menu to break? I have been experiencing this off and on since 4.9.x and am still seeing the issue manifest on the latest 4.10.3. Just retrieving a list of categories seems to trigger the problem, e.g.:

$categories = $cscartapi->get("categories", ['items_per_page'=>1000]);

After running this query, drop-down menu items disappear and the category pages show a 404. Clearing cache doesn't help. The products / categories are still present in the back-end. This is worrisome for using the API on a production site... the only way I am able to resolve is to reload a database backup.

Are you talking about the api itself or the helper class that is wrapped around it? Not sure the helper has been updated for quite some time....

Hey everyone,

I made a simply helper class for CS-Cart 4 API. With this class, everyone can easily access to the API, without getting issues with the cURL extension, headers, authentication, etc.

Just call the CSCartAPI class with 3 parameters, and after it you can access the api() method. Using is easy, and free!

Everyone can download it from my GitHub repo.

I made some tests, so it is working, but not the best at the moment. I accept suggestions, improvements and bug reports smile.png

Regards,

Istvan Drahos

Very nice but I am newbie to cs-cart, may I know what I should put to the api_url?

@tbirnseth I am using the helper class. The class is pretty minimalist, so I'm not sure why it would contribute to the behavior I'm seeing. I can bypass the class if necessary, but before doing that I think I'll do a DIFF on the database before and after an API call is made to identify what it actually happening in CS-Cart.

@tbirnseth I am using the helper class. The class is pretty minimalist, so I'm not sure why it would contribute to the behavior I'm seeing. I can bypass the class if necessary, but before doing that I think I'll do a DIFF on the database before and after an API call is made to identify what it actually happening in CS-Cart.

If you're running 4.10.x, I would not trust anything... I've recommended to all my clients that they NOT upgrade to 4.10.x until thing get flushed out and it stabilizes and remain at 4.9.3. It's going to take me months to validate/change all my addons to be compatible with 4.10.x. Not one of cs-cart's finer moments.

Very nice but I am newbie to cs-cart, may I know what I should put to the api_url?

You should enter the address of your store there. So it's just the domain.

Best regards

Robert

@tbirnseth, thanks for the insight. Good to know add-ons aren't compatible into the 4.10.x series.

Comparing the database before and after API call, the lone change is a new row under cscart_sessions. I'm not sure how to troubleshoot the BLOB data package, but deleting that row magically restores menu / URL functionality. Creating new (non-API) sessions does not impact functionality either. It's possible that something is wrong with the API call, but it is concerning that session data could be stored in such a way as to break cart functionality.

I'll re-attempt on 4.9.x to see whether this issue persists.

The problem appears in 4.9.x as well. Specifically, a new row with session_id ending in ****-0-A is created. The api.php has a NO_SESSION constant equal to true, which I gather means this row should NOT be added to the cscart_sessions table. Deleting only this new row from the database resolves whatever problem is causing CS-Cart to refuse to load menu and pages on front-end. At this point I wonder how many developers are actually actively using the API.