Magento Import to Custom Database Field - database

I have created custom database column in magento 'wholesale_min_qty' in cataloginventory_stock_item.
Question is, I cant update the field by importing from CSV file.
But it is working perfectly fine when updating from admin panel.
Any idea?

I have solved it, by going to
Mage_ImportExport_Model_Import_Entity_Product.
find the function _saveStockItem().
add 'wholesale_min_qty => 0' to $defaultStockData array.
This is done by hard coding to magento core file. You can try to create a module to extend the core file itself, which is a best practice.

Related

How to create a local database in react js

what i'm trying to do is create a local database for user so when he adds an item to shopping cart it gets stored in there, and that database should be local and also unique for every user and basically it's based on they're Api_key so i was wondering what technologies should i use to create that database.
/// what i have tried to do
basically i tried storing the data's in localStorage of the browser but in this case it's no use.
What are you actually trying to achieve here? There are things like lowdb, but I don't think that's what you are after.
sounds like what you're looking for is a cookie. npm package

How to override database selector web page in odoo 11?

I want to beautify database selector web page in Odoo11. How can i do it?
Do i have to create a new module? If yes, then in which database i have to install it?
I found the database selector file in /web/views/database_manage.html
Would suggest of using/adjusting one of the existing modules:
There is one module for this:
https://apps.odoo.com/apps/modules/10.0/web_extend_db_manager_layout/
You can possibly adjust it to your needs as it is open source. Remember to give some kudos to original authors.

Loading Facelets templates from database

In my application (CMS for internal purposes) I'm facing the problem how to serve pages stored in the database with dynamic URL (e.g. http://example.com/page3) using the JSF. Generally, let's say I want to grab the page content from the database, put it inside jsf file and serve it as /page3. Is there any way how to obtain the request URL from JSF, search the database for the article (instead of searching *xhtml in the WAR), build dynamically the JSF XHML file and return it to JSF as InputStream for example? I've found this answed by Thomas Maerz, but it failed with
Unable to create a new instance of 'com.test.CustomResourceResolver': java.lang.InstantiationException: com.test.CustomResourceResolver
on my glassfish v4 (Mojarra 2.2), and I also found that ResourceResolver is deprecated in JSF2.2.
I've googled a lot, but this seems to be not very common/documented part of JSF.
Thank you for any help.
I did not understand fully the problem, but for url change you can use prettyfaces, for dynamic forms you can use primefaces ext and I am not suggest keep form in the database, if I know your target I can suggest more useful answer.

How to create a custom module from Webforms in Drupal 7

I have a form that I am aiming to submit to paypal payment.
I have tried several options like the Paypal API and the like but I can't seem to get the hang of it since the requirement of what I am doing is pretty simple.
Right now I have a form and I am using Webforms to build it. I am well aware that webforms has its default value for action attribute which is not so easy to alter.
Also, the names for the inputs appear to be something like:
name="submitted[last_name]"
To be direct, I would like to change the actions url of the webform and then the field names from to simply name="last_name"
Is there a simple way to do it? If there is, I would appreciate your suggestion.
Also, if what I assume based on my reading that it is not possible, I have read in this question (Using Hook_form_alter on webform submitted values) that I can create a custom module based on webform and make the changes there. The problem is that I am new to drupal and I am still trying to understand how to make things work and I have no idea how to start or create the custom module based on webforms. Is it just simply copying the whole files in webforms then replace all occurences of webforms to my custom module name?
You dont create a module from webforms, instead the usual practice is to hook in to specific form from another module.
Basicly you need 1 folder and 2 files in there, eg mymodule folder and mymodule.info + mymodule.module . Good place to place those would be sites/all/modules/custom/ under your installation directory.
Read the description about .info file at https://www.drupal.org/node/542202
You can connect to webforms in many ways but the standard way in most form tampering cases start with hook_form_alter. Your module could start with something like this
<?php
function mymodule_form_alter(&$form, &$form_state, $form_id){
/* find and tamper with $form here
install devel and then uncomment the following */
//dpm($form);
}

The newly added field's value not saved in db by magento

In Magento I created a new module as like the customer module.
Everything will be fine.
In my module there are some additional fields, but the values are not being saved into the db.
Only particular fields save into db.
I have not created a setup file as in the core part.
Do I require a setup file? And if yes how may I do it please?
How to set the default entities.
delete cache .
And if problem exists.Refer Link 1.Hope this helps you.

Resources