0

I wan't to fill information of a store , this information:

  1. Store Name

    Store Phone Number

    Country

    Region/State

    Postal Code City

    Street Address

I know how to get this information like below:

public function getStorename()
    {
        return $this->_scopeConfig->getValue(
            'trans_email/ident_sales/name',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }

 public function getStoreEmail()
    {
        return $this->_scopeConfig->getValue(
            'trans_email/ident_sales/email',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }

is there a method called setValue() ?

greetings!

1 Answer 1

0

Hi I have found the way to do this:

//Store Information
         $websiteId = $website->getId();
         $this->config->saveConfig('general/store_information/name',"Tienda H",'webistes',$websiteId);
         $this->config->saveConfig('general/store_information/phone',"4441842816",'webistes',$websiteId);
         $this->config->saveConfig('trans_email/ident_general/email',"[email protected]",'webistes',$websiteId);
         $this->config->saveConfig('general/store_information/postcode',"[email protected]",'webistes',$websiteId);
         $this->config->saveConfig('general/store_information/city',"San Luis Potosí",'webistes',$websiteId);
         $this->config->saveConfig('general/store_information/region_id',"[email protected]",'webistes',$websiteId);
         $this->config->saveConfig('general/store_information/street_line1',"Av de Prueba 122",'webistes',$websiteId);

use Magento\Config\Model\ResourceModel\Config; for config model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.