Explain the Module Contact Form on Prestashop - prestashop-1.7

I am reading Contact Form Module and although everything is very clear I can't understand why Configuration::updateValue( self::SEND_CONFIRMATION_EMAIL, Tools::getValue(self::SEND_CONFIRMATION_EMAIL) ); does not been saved on Configuration table...
Presta 1.7.7.0
Any suggestion?

Are you sure that you have checked the right row in the configuration table?
In the beginning of the contactform.php, is defined the constant
const SEND_CONFIRMATION_EMAIL = 'CONTACTFORM_SEND_CONFIRMATION_EMAIL';
So, if do you want to check the self::SEND_CONFIRMATION_EMAIL value, you need to search for CONTACTFORM_SEND_CONFIRMATION_EMAIL in table

Related

How to get values from catalog_product_entity_varchar?

I'm trying since hours to get some values from the table
catalog_product_entity_varchar
with no succes.
How is this table connected to the products?
I have a product with a custom attribute "materials" and I found the values in this mentioned table.
There is no result when I try to do this:
$_product->getAttributeText('materials');
#credit goes to this answer: https://magento.stackexchange.com/questions/13330/how-to-get-dropdown-and-multiple-select-value-for-a-product-collection
the following should work:
$_product->getAttributeText('some_dropdown_attr');
Therefore only the following could be happening:
You must have mis-named your dropdown attribute
Ensure that the attribute has valid values applied on the current store view
If all else fails, there may be a problem with your attribute setup code; for instance, not visible in the frontend isn't set properly and you're using flat tables...
In that case to debug output it with the following code:
$attr = $_product->getResource()->getAttribute('some_dropdown_attr')->getFrontend()->getValue($_product);
If that works check your catalog attribute configuration or disable flat indexes.
Hope this help !!

Joomla 'sobipro' - extracting data

I have taken over a Joomla project that needs rebuilding.
I need to get out the user data and some other data linked to users, I have found most of it in the jos_user table and also a table named jos_comprofiler.
There is data inside of jos_sobipro_field_data that I also need, but I do not know how this table related to anything else can someone please explain? I am able to write SQL and the JOIN statements to get it out once I understand how it all fits together.
Finally the table jos_comprofiler references an avatar which is an image name like '100_4f97c0b3c2c31.jpg' where can I find these images?
Thanks, Jake
I can tell you where those tables are coming from:
- jos_users is the user table used by Joomla core, together with jos_user_profiles for additional profile information.
- jos_comprofiler is a table created by the Community Builder extension from http://www.joomlapolis.com/.
- jos_sobipro_field_data is a table created by SobiPro from http://sobipro.sigsiu.net/
Maybe that helps you find the next steps. Maybe someone else knows more details.

mutual exclusion in joomla

I created an extension for joomla using:
$id=$database->insertid();
I just covered that if two users are logged on to the site will fit together perform two records in the database and then this statement will return in both cases the same value.
in php you can solve this problem with the transactions.
In joomla how do I solve this problem?
If you have a table you are working with that extends JTable then make sure that you included the check out functionality that is optionally a part of that. THis must means adding a couple of fields like what is in the content table. This will prevent two people from editing the same row at the same time which creates a race condition in which one of the other will lose their data.
Please note that both php and joomla functions to return the last insert id rely on the mysql implementation, and mysql returns the last id inserted on the currently open connection so concurrency is not an issue
#iacoposk8 Your are right it might possible that in very rear case. Such time try to add current logged in user id in your sql query or any where so that it doesn't make any confict. I hope you get it what i want to say. Thanks

Concrete 5 ADODB update and insert duplicate primary key

I'm creating a new package for Concrete 5 (5.4.0+). Inserting a new block works perfectly. But when I edit an existing block, it tries to INSERT again when I click 'save', instead of UPDATE.
The two fields on the database that affect this are bID and eID. Both are non-auto-incrementing INT(10) default none NOT NULL.
The values are passed in an associative array $args in the controller and I'm calling the parent save method with Parent::save($args);
Any help/input would be appreciated. PS: I have looked over this on the net and the C5 forums did turn up some stuff which I tried, mostly relating to the database fields, but I still get the above error. I don't want to overwrite the ADODB save() method if possible.
--- EDIT ---
Perhaps I'm looking at this all wrong. Let me say what I'm trying to achieve. I need the eID to remain 37 (for example) across multiple edits of the block. The bID can increment away AFAIC.
How do I get the eID to remain 37 on edit, but increment by 1 on creation of a new instance? Make sense?
A second table references the eID field, and edited instances of an entry on this table must have the same eID unless a new instance is created. Sry - clear as mud I know.
Are you saying you get a new instance of the block appearing on your page, rather than a new version of the existing one? I don't think the problem is with there being a new record inserted in your table, since new records are normally created when you edit a block. C5 keeps the older version of the block.
The custom blocks I've done have never required a call to the parent save method. You just need an edit form that collects the data and designates which database field it corresponds to, and the parent controller knows what to do with it when the form is submitted.
For example, if you have a text field in your block table called "firstname" that you are updating, you would add a line to your edit.php file like this:
<?php echo $form->text('firstname', $firstname, array('style' => 'width: 320px'));?>
My block editors contain little else than this, other than html/CSS stuff to add labels and make the form look better. The $form object takes care of everything else.
One thing that really helped me understand blocks and block controllers was to download and install the "designer content" add-on. It's free. You can use it to build some custom blocks, then look at the code it generates to perform various functions.
So I looked into the existing packages to duplicate this funcitonality and my question has evolved into this: PHP Concrete 5 Pass Variables to Add.php
Follow the rabbit ;)

Magento: Add New Field to Credit Card Form

I'm trying to modify the credit card form to add some new custom fields named "Bank Name" and "Bank Phone Number" and it seems this cannot be done through the back-end.
I've searched the web and on here but I haven't been able to find anything in reference on how to add a new custom field to the credit card form. I would think it's almost the same as adding a new field to the customer registration form but I have no clue what to do database wise.
If anyone has anything I can use to work on this, I'd greatly appreciate it.
You should start by informing which version of Magento you are using and which methods you have already tried.
Without knowing that it is hard to help you, but you might want to try this possible solution, this one, or even one of these modules: Checkout Fields Manager or ADDITIONAL CHECKOUT ATTRIBUTES. If none of the above work, try this search.
No, Magento admin panel will not add custom columns for you. You need to do it yourself.
First, you need to edit the .phtml file to include these two fields to show up in frontend.
Second, you need to add two new columns (with same name as your fields, explained later) in relevant DB table (i guess sales_flat_order_payment). But that will affect for all payment methods, so define it something like VARCHAR(255) NULL.
Third, when Magento saves the CC info, you need to check if it is saving whole data array, then your field's name posted will match your table field and get inserted automatically. Else you need to edit it.
Also, next time please post some code, atleast something you have tried.

Resources