Hybris ecommerce add product to cart via querystring - web-services

It is possible to add a product to cart via a query string ?
How can I do that if it's possible?

Yes you can do it out of the box using Omni Commerce Connected (OCC) commerce API (see documentation for cart):
For example :
URL : https://localhost:9002/rest/v1/electronics/cart/entry
Parameters (query string) : code=3429337
Result : Adds product with code=3429337 to the cart

Yes.
Are you using the Accelerator? Add a method to a new or existing Controller that accepts a product code as a request parameter (#RequestParam) and uses a Facade to add the product. The actual Facade implementation is looking up the session cart, looking up the Product via FlexSearch (or through a Service), then adding the Product to Cart. You can look at the existing add to cart functionality to get a start. The main thing of creating a method to accept the query string is an exercise in Spring MVC.

Use the existing mechanism as someone has actual thought about it.

Related

Bitrix 24 - Adding custom field to product list on deal

I'd like to add a new field to product list available to be variable to each deal (like quantity, for example). Is it possible to be done? Thanks in advance.
This is the moment I need this new field to appear:
You can add new fields to products in both cloud and on-prem versions. You can view these special fields while adding product to DEAL cards, but it is not possible to view those under the product tab of DEAL cards.
You need to develop a Bitrix24 application for that purpose utilizing the REST API or B24 JS library.

How to use Django Rest API in Django normal project for autocomplete using Select2?

In my Django project, I have a model named Product. The model consists of products which have following entities:
name, id, price and so on.
In my project, an admin can add a new/old product anytime.
Now, for searching, I want to add autocomplete. I want to use Select2.
So users don't have to memorize the name of the products. To do that I found out here in the Select2 doc
that :
Select2 comes with AJAX support built in, using jQuery's AJAX methods
With this, I can search an API and fetch the data to show the users in autocomplete search field.
My Question:
Should I create a Django rest API and use that API to store products and fetch the data?
1.1 Would it be wise?
1.2 Is it possible to make a rest API within a normal Django project? If not then how to do that?
Or should I just use a normal urls.py and querying the result from
Select2 ajax function to that urls.py and to a custom query.py and
fetch the data directly from the database?
I don't think using rest framework with normal Django project would cause any problem. You are just adding some extra urls, that's all. It won't cause any problem to your project. Moreover, you can use the API to get json data of various models.
Hope this helps.

Ruby on rails - Add multiple record from new action

In my application I have Domain model that have these columns: name, link, description.
Currently my application works as I can only add one domain at a time (from new action). What I am looking for is to be able to add as many domains as I want from the same form/page.
I have used nested_forms before but usually its nested_attributes for another model.
How am I able to have nested_forms for same model or if there is any other way?
This can be done, but not in a RESTful way. There are some hacks to do it, But I don't recommend and best way would be to do associations and adding nested_attributes to it.

Autocomplete field in Web Forms for Marketers and custom Field validator

I am using WFFM in Sitecore 7.1 , one of the requirement to have a field named Countries and want to use it as autocomplete field.
I have already loaded all the Countries in Sitecore as Sitecore Object.
I was following the Custom Credit card field , but it didn't help much.
I created custom autocomplete Field in WFFM and now i want to create custom validation for this field .
Any help..
Thanks
To keep it simple you might want to consider a custom control like credit card and use client side JS to call your countries via sitecore web API and then do all the auto complete stuff in the js leaving all logic there.
If server side code is a preference then u can write a web service to return you the JSON objects of matching countries making your JS more simpler.
Hope this can help with some ideas.

Django Admin Limiting results based on URL

I'm working a conference registration page. The system can allow multiple conferences to be registered for and used.
I'm using the admin to manage the conferences, but I need a way in the admin system to view only the people registered for a given conference. I know I can use list filters, but I was wondering if I can somehow use the URL.
For example, is it possible to do something like this? /admin/appname/modelname/SomeConference and only have that show the instances of that model associated with that confernece?
This is what filters are specifically for.
If you look at what happens when you activate a filter in the Admin, it just updates the URI to include a lookup value:
http://example.com/admin/core/model/?model_id__exact=1
So "technically", yes, there's a way to do this just using a URL.
Because that's how filters work in the first place.