texts: How to add product to the cart with customer id and product id magento 2.3?

texts:
Actually while adding product to the cart with product id and customer id, i am facing one error "We found an invalid request for adding product to quote."
If anyone have any idea please guide me.

<?php
namespace Vendor\Module\Model;

use Vendor\Module\Api\CustomerServiceInterface;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollection;
use Magento\Catalog\Model\ProductFactory as ProductFactory;
use Magento\Store\Model\StoreManagerInterface as StoreManager;

class Customerservice implements CustomerServiceInterface
{

    private $productCollection;
    private $ProductFactory;
    protected $_storeManager;

    protected $_product;
    protected $_customerserviceFactory;
    protected $_customerRepositoryInterface;

    protected $_quoteModel;

    protected $_productRepository;

    protected $_cartManagementInterface;

    protected $_cartRepositoryInterface;

    public function __construct(ProductCollection $productCollection,
        ProductFactory $ProductFactory,
        \Magento\Catalog\Model\Product $product,
        \Vendor\Module\Model\CustomerserviceFactory $customerserviceFactory,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
        \Magento\Quote\Model\Quote $quoteModel,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
        \Magento\Quote\Api\CartManagementInterface $cartManagementInterface,
        \Magento\Quote\Api\CartRepositoryInterface $cartRepositoryInterface,
        StoreManager $_storeManager)
    {
        $this->productCollection = $productCollection;
        $this->ProductFactory = $ProductFactory;
        $this->_storeManager = $_storeManager;
        $this->_customerserviceFactory = $customerserviceFactory;
        $this->_product = $product;
        $this->_customerRepositoryInterface = $customerRepositoryInterface;
        $this->_quoteModel                   = $quoteModel;
        $this->_productRepository            = $productRepository;
        $this->_cartManagementInterface = $cartManagementInterface;
        $this->_cartRepositoryInterface = $cartRepositoryInterface;
    }

    public function customerservice($params) {

        $customerId = 13;
        $productId = 81;
        try {
            $product = $this->ProductFactory->create()->load($productId);
            $params = array(
                        "product" => $productId,
                        'qty' => 1,
                        "price" => 160
                    );

            $request = new \Magento\Framework\DataObject();
            $request->setData($params);
            $quoteId = $this->_cartManagementInterface->createEmptyCartForCustomer($customerId);
            $quote = $this->_cartRepositoryInterface->get($quoteId);
            $customer = $this->_customerRepositoryInterface->getById($customerId);
            $quote->assignCustomer($customer);
            $productAddToCart = $this->_productRepository->getById($productId);
            $quote->addProduct($productAddToCart, $request);
            $this->_cartRepositoryInterface->save($quote);
            $quote->collectTotals();
            //$quote->collectTotals()->save();

            echo json_encode("product added");
        } catch (\Exception $ex) {
            print_r($ex->getMessage()); exit;
        }

    }

}


texts: How to run a specific cronjob from a group from the console, in Magento 2?

texts:
This is my crontab.xml content:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="my_special_group_name">
        <job instance="path\to\my\class" method="execute" name="my_special_cron_name">
            <schedule>*/2 * * * *</schedule>
        </job>

    </group>
</config>

By running bin/magento cron:run --group="my_special_group_name" I am getting the message of Ran jobs by schedule. , but i want to know what is the equivalent of the command ./n98-magerun.phar sys:cron:run my_special_cron_name  ? using the bin/magento

Thnx for the help in advance!


texts: how to improve high load time in magento2

texts: I am getting very high load time in magento 2 even I have the best score in all aspects how to improve load time I am on magento 2.3.4 Kindly help


texts: Display maximum price amount for configurable product in magento 2

texts:
By default magento 2 takes the lowest price from the simple product and displays on the product listing page.
However, is there any way, where Magento 2 takes the highest price amount and display on the frontend??


texts:
So my Plesk default php version is 5.4 .
On my domain where i want to install Magento 2 ( last version ) I have changed the php version to php 7.0 but when i want to install Magento manually it doesn't recognise the version that i have choosed.

What may cause the problem ?


texts: Magento2 : Module and theme not working together

texts:
I have purchased a theme and a module, but after installing both modules is not working. I am tow in Magento and don't know how to detect the issue. Module "catelog_product_view.xml" code is like below,

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="product.info.form.options">
        <block class="FME\Pricecalculator\Block\Product\Pricecalculator" name="fme.pricecalculator" template="FME_Pricecalculator::pricecalculator.phtml" after="-"/>
    </referenceBlock>
</page>

Is it overwriting the method or function? any help will be appreciated.


texts: How to redirect custom shipping to default payment magento 2?

texts:
In my case, I have external script shipping method magento, in here I want to redirect my shipping method to payment page on magento, so this is my custom page shipping

after that the page is will be redirected to this page

in here I want the page redirected with the data from my custom page shipping, can anyone give me the step


texts:
I have a site with multiple websites in a single magento instance.Each website has a different root catalog.

I am trying to generate category urls using this https://github.com/olegkoval/magento2-regenerate_url_rewrites

But category urls are generating with two htmls  like the below: brands/crp/collections.html/st-tropaz-collection.html

Can any one please guide me on this


texts: Why do I have 13 different Cron.php and what do I do with them?

texts: I have 13 different Cron.php files in several different folders. All of the issues I'm having on Magento seem to be related to cron jobs. Cron job is running, but it doesn't do anything it's supposed to, e.g. send order e-mails, send the newsletter, sync to MailChimp. Am I supposed to do something with all of these Cron.php files? Am I meant to consolidate them somewhere?


texts:
we are using Magento 2.3.1 and Porto theme

when I click on product its showing below mentioned error - https://offineeds.co.in/4-in-1-touch-led-lamp.html

Fatal error: Uncaught Error: Call to a member function getData() on null in / home/offinee8/public_html/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/details.phtml:18
 Stack trace:
 #0 /home/offinee8/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include()
 #1 /home/offinee8/public_html/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Details), '/home/offinee8/...', Array)
 #2 /home/offinee8/public_html/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView('/home/offinee8/...')
 #3 /home/offinee8/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml()
 #4 /home/offinee8/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()
 #5 /home/offinee8/public_html/vendor/magento/framework/View/Layout.php(533): M in /home/offinee8/public_html/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/details.phtml on line 18


texts: Magento 2 | Component manager wont work after migration

texts:
I finally managed to migrate my Magento1 (1.9.1.0) to Magento 2 (2.1.3) with the Data-migration tool from Magento.

Everything went well, after a few mapping issues and fixes for that the migration went straight trough.

But as soon i want to install a few extensions from the marketplace and i have to enter the keys (public & private) to login into the account i get a never ending "Please wait" -popup. After closing and reloading the Web setup wizard the keys are saved but the extension grid wont show... just another neverending "Please wait..." popup.

Do you guys know anything about that ?

Do you guys know how to fix that ?

What i've already tried:

Reindexing
Cleaned cache
Reloading the site and tried again

Update:

Found a warning when entering the component-manager page:

The specified value "{{currentPage}}" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?

Still cant figure out why i cant get this to work.


texts: magento url rewrite seems make my website slow

texts: The core_url_rewrite is continuously growing infinitely, and my store only got 1000 products, the URL Rewrite Management at backend have "Total 43680 records found", and it is growing, how can i reduce the size of the table, and limit the grow of the table?


texts: solve problem of not plus shipping method price in total in multiple shipping overview page

texts: any one have solution about the below image please help me


texts: Where body tag styles are defined in Magento 1.9

texts:
I have spent several hours trying to figure out this.

The fact is that I have a site that has a BODY tag with certain classes for style. I need to change those classes, but I have not find where are they.

Any help, please?

Regards

Jaime


texts: Cannot process definition to array for type time in Magento 2.3.3

texts:
I'm getting the following error "Cannot process definition to array for type time" on Magento 2.3.3 when executing command:
php bin/magento setup:upgrade

Thank you for your advanced!


texts: There was no Home CMS page configured or found

texts:
I already look online and still can't solve this problem, I have to do this my self because my developer is on a vacation.

This is my website: http://www.trenpon.com/

The website home page was working properly until I change the "Title" and "URL key" In CMS > Pages, now the page is not showing anymore and I forgot the default title and URL key :P. Can someone teach me how to fix the "no home page found" problem in this situation I have right now? Thank you very much.


texts: How to duplicate Product Price and insert next to configurable options?

texts: I'm trying to display pricing again on the product page right above my configurable product options. How can I go about doing that? I've tried to copy the code on view.phtml to my wrapper.phtml and it's not working.


texts: How to exclude inactive categories from catergories sitemap

texts:
I've just noticed while testing that my sitemap shows inactive categories in on my Magento ver. 1.9.1.0 install. I saw a post that seems to address the issues via the app/design/frontend/base/default/template/catalog/seo/tree.phtml link. My problem is I get a n error code when I try this.

    <?php $_items = $this->getCollection(); ?>
<?php if($_items->getSize()): ?>

    <?php if( $_item->is_active ) : ?>
        <?php foreach ($_items as $_item): ?>
            <li class="level-<?php echo $this->getLevel($_item) ?>" <?php echo $this->getLevel($_item)?'style="padding-left:' . $this->getLevel($_item, 2) . '0px;"':'' ?>><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $_item->name ?>

        <?php endif; ?>
        <?php endforeach; ?>

<?php else: ?>

        <?php echo $this->__('There are no %s available.', $this->getItemsTitle()); ?>

<?php endif ?>

I think because the if statement is not being closed properly. When I trying joining the if statements like this.

<?php $_items = $this->getCollection(); ?>
<?php if($_items->getSize && is_active()): ?>

    <?php foreach ($_items as $_item): ?>
            <li class="level-<?php echo $this->getLevel($_item) ?>" <?php echo $this->getLevel($_item)?'style="padding-left:' . $this->getLevel($_item, 2) . '0px;"':'' ?>><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $_item->name ?>

           <?php endforeach; ?>

     <?php else: ?>

        <?php echo $this->__('There are no %s available.', $this->getItemsTitle()); ?>

I don't get an error but all that shows is the php else message "There are no available." any help would be appreciated.


texts:
Is there a solution for adding weight to custom options? So that the overall product weight is adjusted based on custom options selected?

(Or is anyone aware of any extensions that can add this functionality?)


texts: Removing ShipFree coupon is one product in cart matches specific category

texts:
First post so bare with me. We have an issue with the logic on our Shipfree coupon code. What we want is to invalidate the shipfree coupon code if any one product in the cart is assigned to a specific category. We'll call this category "over-sized items".
Right now if a customer has one item in the "over-sized items" category and one item that is not, Magento will still apply the coupon. How can we get it to invalidate the coupon based on that one item in the "over-sized items" category?


texts: Disable Category Page Description Content from showing on Additional Pages

texts:
How can we remove the category descriptions for "additional pages".. like

http://www.uretilalt.dk/herreure?p=10

For instance?

Manage to remove from filtered results, but can't figures this part out?

Magento ver. 1.9.2.4


texts: "Undefined variable: packagesForInstall" while sync with Magento Marketplace

texts:
When I hit the Sync button in the "Component Manager" in order to synchronize with the Magento Marketplace, I get the error 500 below and "Undefined variable: packagesForInstall".
I'm running Magento in a Plesk environment.
The version of Magento is 2.0.7
Any clue why I get this issue ?
ErrorException
File:
/var/www/vhosts/doombyte.com/httpdocs/setup/src/Magento/Setup/Controller/ComponentGrid.php:195
Message:
Undefined variable: packagesForInstall
Stack trace:
#0 /var/www/vhosts/doombyte.com/httpdocs/setup/src/Magento/Setup/Controller/ComponentGrid.php(195): Composer\Util\ErrorHandler::handle(8, 'Undefined varia...', '/var/www/vhosts...', 195, Array)
#1 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\ComponentGrid->syncAction()
#2 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#3 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#4 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#5 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#7 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#8 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#9 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /var/www/vhosts/doombyte.com/httpdocs/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/vhosts/doombyte.com/httpdocs/setup/index.php(31): Zend\Mvc\Application->run()
#12 {main}```


texts:
In homepage  products are not displaying , that how many i mentioned in single line .

If i mentioned 5 products in each line , it shows 4 products and the next line remaining one will be displayed . Then second line also in the same way and complete homepage having the issue . You will get understand when you see the bellow image .

you can check in this page link

i am working on magento1.9 . Please help me solve the issue.


texts: Generate invoice even if product is pending or disable

texts:
After order is placed, if product status change to disable or Pending its not possible to generate invoice.

How to generate invoice even if product is pending or disable without changing status of product?


texts:
<?php
set_time_limit(0);
require_once 'app/Mage.php';
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$file_handle = fopen("/var.../test.csv","r");
$file_count = 0;

while (!feof($file_handle)) {
    $fieldval = fgetcsv($file_handle, 1024);
    $val1 = $fieldval[1];
    $val2 = $fieldval[7];
    echo $product_id = Mage::getModel("catalog/product")->getIdBySku($val1);
    $_product = Mage::getModel('catalog/product')->load($product_id);

    if($file_count>0) {
        $_product->setData('custAttr', $val2);
        $_product->save();
    }

    //echo $fieldval[1].$fieldval[7]."<br>";

    $file_count++;

}
fclose($file_handle);

In the above code, i read values from csv and update customatrribute. Everything is fine when the skus in excel is same as that of magento site.
But somehow the cron is not working when the sku is different. Could anyone help me how to check if sku not exist in magento?


texts:
1,400 products were deleted fro my PROD Magento 2.2.1 community store.

Looking at the admin_user_session table there is an entry at the time I suspect the mass deletion was executed.

Is there an explanation for this?


texts: Magento 1 native gift card module or third party that you can use in physical stores as well as online

texts:
Be able to deduct balances if a certain amount was used at a physical location etc etc.

Is there anything out there like that?

I know magento has the native gift card standard online use. It would be nice to have physical cards as well that work for both.


texts:
We have Magento EE 1.14.0.1. recently we moved to new AWS EC2 server and ElasticCache Redis server.  then some random products start disappearing in the frontend. They exist on backend and configured correctly ( visible , enabled , in stock , etc ....  ). And only after you save the product in backend it will show up again in frontend even without flushing any cache.

Is this issue related to Redis cache ?
and if its how to fix it ?

Any input would be appreciated to direct me to a solution.

Thanks

Update: I marked everything under Index Management to Update on Save. so I revert that back to update on schedule. and I think that fixed the issue. but still I want to keep my store inventory up to date.


texts: Magento 2.3 adding column to inventory_source

texts:
I've added a new column to inventory_source successfully and it's working, here is the tutorial I've followed.
The issue is the data saved to the database is not showed in the form, the field appear empty but the data is in the database.
The Steps I've done are:

Created extension_attributes

Created event to save the data

Created inventory_source_form.xml to view the field
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general" sortOrder="10">
        <field name="branch_erp_id" formElement="input" sortOrder="25">
            <settings>
                <validation>
                    <rule name="validate-number" xsi:type="boolean">true</rule>
                </validation>
                <dataType>number</dataType>
                <label translate="true">Branch ERP Id</label>
            </settings>
        </field>
    </fieldset>
</form>```

The di.xml file:
<type name="Magento\InventoryApi\Api\SourceRepositoryInterface">
    <plugin name="plugin_source_save" type="vendor\module\Plugin\InventorySource\Source"/>
</type>

The plugin file Source.php:
<?php

namespace vendor\module\Plugin\InventorySource;

use Magento\InventoryApi\Api\SourceRepositoryInterface;
use Magento\InventoryApi\Api\Data\SourceInterface;
use Magento\InventoryApi\Api\Data\SourceSearchResultsInterface;
use Magento\InventoryApi\Api\Data\SourceExtensionFactory;
use Magento\InventoryApi\Api\Data\SourceExtensionInterfaceFactory;

class Source
{
    const FIELD_NAME = 'branch_erp_id';

    protected $extensionFactory;
    protected $sourceFactory;

    public function __construct(SourceExtensionInterfaceFactory $extensionFactory)
    {
        $this->extensionFactory = $extensionFactory;
    }

    public function afterGet(SourceRepositoryInterface $subject, SourceInterface $source)
    {
        $sourceBranchId = $source->getData(self::FIELD_NAME);
        $extensionAttributes = $source->getExtensionAttributes();
        $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create();
        $extensionAttributes->setBranchErpId($sourceBranchId);
        $source->setExtensionAttributes($extensionAttributes);

        return $source;
    }

    public function afterGetList(SourceRepositoryInterface $subject, SourceSearchResultsInterface $result)
    {
        $products = [];
        $sources = $result->getItems();

        foreach ($sources as $source) {
            $sourceBranchId = $source->getData(self::FIELD_NAME);
            $extensionAttributes = $source->getExtensionAttributes();
            $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create();
            $extensionAttributes->setBranchErpId($sourceBranchId);
            $source->setExtensionAttributes($extensionAttributes);
            $products[] = $source;
        }
        $result->setItems($products);
        return $result;
    }
}


texts:
When I  try create credit memo I get this issue:
1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): You can not refund shipping if there is no shipping amount.

Exception #0 (Magento\Framework\Exception\LocalizedException): You can not refund shipping if there is no shipping amount.
<pre>#1 Magento\Sales\Model\Order\Creditmemo->collectTotals() called at [vendor/magento/module-sales/Model/Order/CreditmemoFactory.php:97]

Anyone have  any solution?


texts: Product reviews missing even on default theme

texts:
We have a very strange problem.

We are not able to see the product reviews on the product page. Also the summary just below the product title with "write a review" is not showing up.

What I've done so far:

I've checked the module (Mage_Review) --> This is enabled
Switched to default magento theme to see if it's there (not visible)
Allow product reviews for guests --> Set to yes / no, not any difference
Added reviews on the backend --> Going OK
Checked the XML files and compared them with a fresh install.

It doesn't matter if you're logged in or logged out.


texts: Magento 1.9 - in onepage.phtml $_stepInfo['label'] - where is ["label"] coming from?

texts:
In frontend/base/default/checkout/onepage.phtml there is a foreach loop

<?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>

which renders the checkout steps

<?php echo $_stepInfo['label'] ?>

As fas as I know the getSteps() comes from app/code/core/Mage/Checkout/Block/Onepage.php

public function getSteps()
{
    $steps = array();
    $stepCodes = $this->_getStepCodes();

    if ($this->isCustomerLoggedIn()) {
        $stepCodes = array_diff($stepCodes, array('login'));
    }

    foreach ($stepCodes as $step) {
        $steps[$step] = $this->getCheckout()->getStepData($step);
    }

    return $steps;
}

which extends to the class in app/code/core/Mage/Checkout/Block/Onepage/Abstract.php

protected function _getStepCodes()
{
    return array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review');
}

But where is the ["label"] part coming from? Or how could I add an additional step to the checkout as well as the correct new label for it?
Thx


texts: Logged in customer with setCustomerAsLoggedIn() logs out automatically after redirect

texts:
Freshly created and active user, after redirection to user cabinet logged out instantly:

                $this->_session = Mage::getSingleton('customer/session');
                $session = $this->_session;

                $customer = Mage::getModel('customer/customer')->setEmail($email)
                                                               ->save();
                // ^^^ successfully saves the customer entity

                $session->setCustomerAsLoggedIn($customer);

                // autoconfirm user
                if($customer->getConfirmation()!=null){
                    $customer->setConfirmation(null);
                }
                if($session->isLoggedIn()) {

                    Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getBaseUrl().'customer/account/');
                    return;
                }

it successfully redirects and shows the user cabinet and 'Log out' link is active, but if I open the magento front page in other tab of same browser it becomes clearly that customer is not logged in.
Where to debug ?
Thanks!

UPDATE

I am trying to login freshly created customer without password. Password attribute set to 'required'=>false in customer entity, via install script.

UPDATE 2

I was also forgot to $customer->save(); after $customer->setConfirmation(null); it is mandatory


texts:
We are running magento 2 on below setup

Apache > Varnish > NGinx SSL termination

On initial setup we were getting the below error for all assets in pub/static

Failed to load xxx: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.

I have added the below to /pub/static/.htaccess this resolved our issues for .css files and all other assets except .html files and .json files

<IfModule mod_headers.c>
<FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|html|json|swf|eot|ttf|otf|woff|woff2)$>
   Header set Cache-Control "max-age=604800, public"
   Header set Access-Control-Allow-Origin "*"
   Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS' always"
   Header set Access-Control-Max-Age "604800"
   Header set Access-Control-Allow-Headers "Host, Content-Type, Origin, Accept"
</FilesMatch>
   <FilesMatch .*\.(zip|gz|gzip|bz2|csv|xml)$>
       Header append Cache-Control no-store
   </FilesMatch>
</IfModule>

Our header from our CSS files and HTML matches so I am not sure why only HTML files are showing this error. Headers below

HTML HEAD

HTTP/1.1 200 OK =>
Content-Type => text/html
Content-Length => 2018
Connection => close
Server => nginx
Date => Sat, 31 Aug 2019 14:46:42 GMT
Last-Modified => Sat, 31 Aug 2019 07:37:44 GMT
Cache-Control => max-age=604800, public
Expires => Sun, 30 Aug 2020 14:46:42 GMT
Access-Control-Allow-Origin => *
X-UA-Compatible => IE=edge
X-Frame-Options => SAMEORIGIN
Access-Control-Allow-Methods => GET, POST, PUT, DELETE, OPTIONS' always
Access-Control-Max-Age => 604800
Access-Control-Allow-Headers => Host, Content-Type, Origin, Accept
X-Content-Type-Options => nosniff
X-Nginx-Cache-Status => EXPIRED
X-Server-Powered-By => Engintron
Vary => Accept-Encoding
X-Cache => Hit from cloudfront
Via => 1.1 XXX.cloudfront.net (CloudFront)
X-Amz-Cf-Pop => ORD50-C1
X-Amz-Cf-Id => XXXOFKszmpSr0kvAFMTr1vEz3lgQZP4RBI53WhL-Q==
Age => 20

CSS HEAD

HTTP/1.1 200 OK =>
Content-Type => text/css
Content-Length => 694946
Connection => close
Server => nginx
Date => Sat, 31 Aug 2019 15:08:32 GMT
Last-Modified => Sat, 31 Aug 2019 14:28:03 GMT
Access-Control-Allow-Origin => *
X-Frame-Options => SAMEORIGIN
Access-Control-Allow-Methods => GET, POST, PUT, DELETE, OPTIONS' always
Access-Control-Max-Age => 604800
Access-Control-Allow-Headers => Host, Content-Type, Origin, Accept
Expires => Mon, 30 Sep 2019 15:08:32 GMT
Cache-Control => max-age=2592000
Pragma => public
Accept-Ranges => bytes
Vary => Accept-Encoding
X-Cache => Miss from cloudfront
Via => 1.1 xxxx.cloudfront.net (CloudFront)
X-Amz-Cf-Pop => ORD51-C1
X-Amz-Cf-Id => xxxx_Kfn0XAc6fyM81iNUQ==

The Access-Control-Allow-Origin => * is visible in both headers. Does anyone know why we may still be getting an error on HTML?

Thanks


texts: Issue with memory setting up Magento 2.0

texts:
I'm trying to install Magento on my VPS (WHM/cPanel) but I get the following error. I've checked the memory and increased it to 512M but still no luck.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 248 bytes) in /home/exampleuser/public_html/vendor/magento/module-sales-rule/Model/ResourceModel/Report/Rule/Updatedat.php on line 36

Things I've tried:

Developer Mode
Check .htaccess file
Changed the php.ini in the root to have more memory
Changed php.ini of the server also ..

I've never had issues with memory before, the Magento system requirements are met.


texts: Magento 1.9.1 Configurable Swatches not sorting Size Field Correctly

texts:
I have enabled configurable swatches for my store, and it looks great. We are displaying shirts, and sizes as our configurable attributes. I would like to sort the size attribute by position, and have set the positions accordingly so that they should sort XS, S, M, L, XL, etc. This worked correctly before the swatches were enabled.

Sizes display in a seemingly random order. I have done some searching and found that there is a reported bug that the options display in the order of the simple product's product ID. I have tried a couple of these fixes without success:

These are the one's I've tried.

Answer 1 on this page:
Magento 1.9.1 configurable product attribute sorting

The one answer on this page:
Magento 1.9 configurable swatches ordered by position

I did clear all of the caches after loading these patches, and I still have the second one in place, but it doesn't appear to have effected the sort order of the size swatches.

I really appreciate any help you can give me on this.

Thanks!
Vi


texts: Captcha not working in Forgot password Frontend in magento2.1.x

texts:
Magento2.1 version in forgot password page captcha not working while I am entering the true captcha.

Finally i found it magento core issue. Does anyone face this issue? any idea how to solve it?


texts: Email Attachment not working in magento 2.3.4 contact us email

texts:
I'm using magento 2.3.4
i customized contact us magento 2 module(Magento_Contact)
i want to Attach file in Email
i followed this blog post
https://meetanshi.com/blog/add-attachments-with-email-in-magento-2-3-x/
but
Create TransportBuilder.php file at Vendor\Module\Model\Mail\Template\TransportBuilder.php
this file
protected function prepareMessage()
    {
        parent::prepareMessage();
        $this->message->setPartsToBody();
        return $this;
    }

$this->message    =>changed to Magento\Framework\Mail\EmailMessageInterfaceFactory;
this class
getting error

Call to undefined method
Magento\Framework\Mail\EmailMessage\Interceptor::setPartsToBody()


texts:
I have a select in a Magento 2 template initialised using the uiClass with the code below:

define([
    'Magento_Ui/js/form/element/select',
    'jquery',
    'domReady',
], function (Select, $) {
    'use strict';

    return Select.extend({
        initialize: function () {
            this._super();

            $("#" + this.uid).closest('div').css('padding', '10px').css('border', '1px solid red')
        }
    })
});

Whilst the select appears as expected, I struggle to change its rendering with jquery.

Has anybody resolved this issue?


texts: Magento 1 Have Suspicious script in head but not declared anywhere

texts: I found a suspicious and possibly dangerous script in the head of a magento 1 site. The script doesn't appear to be declared anywhere. I can't find it in the DB. Where else should I look to see where it's coming from?


texts: Difference between $this->helper('catalog/image')->... vs. (string)$this->helper('catalog/image')->

texts:
Can someone explain how the image helper works in Magento and if the following two lines are identical? They appear to be identical strings when I run var_dump($temp), but memory usage says otherwise on certain products (outside of the scope of this question, but it happens on certain products and casting the string alleviates the problem).

$temp = $this->helper('catalog/image')->init($product, 'small_image')->resize(135);

$temp = (string)$this->helper('catalog/image')->init($product, 'small_image')->resize(135);


texts: Array to string conversion while trying to get product collection

texts:
I'm trying to get a product collection. I got it by function:

public function getProductCollection()
{
    $collection = $this->productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->setPageSize(3);

    return $collection;
}

And my template file is:

$productCollection = $block->getProductCollection();
foreach($productCollection as $product) {
    echo $product->getData() . "
";
}

But I got an error Array to string conversion in this line:

echo $product->getData() . "
";

Could someone tell me why?


texts:
I've upgraded my M2 CE from 2.1.3 to 2.1.11. Everything seems to be working, but I can't add product to cart. From any location on the website. There's nothing is reports nor log files.

When I click ADD TO CART, it's adding it forever. I get a blank popup where it should say that my product is added to shopping cart, and loader over the shopping cart icon is just hanging in an endless loop.

I've tried several different solutions I've found from people having the same issue, but nothing seem to work.

Please help, this is a huge showstopper for me.


texts: Save Magento 1.9.2 contact form data in database?

texts:
I want to store Magento 1.9.2 contact form data into database?
I have create a New DB Table and create new Module on local Pool but Controller overwrite is not working.

I want to send email as well store all the data in my custom table.

My Code Is:

/app/etc/modules/Codefire_Contacts.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Codefire_Contacts>
            <active>true</active>
            <codePool>local</codePool>
        </Codefire_Contacts>
    </modules>
</config>

/app/code/local/Codefire/Contacts/controllers/indexController.php

<?php

require_once(Mage::getModuleDir('controllers', 'Mage_Contacts') . DS . 'IndexController.php');

class Codefire_Contacts_IndexController extends Mage_Contacts_IndexController {

    //your targeted controller action rewrite here
    public function indexAction() {
        parent::indexAction();
        echo 'Good';
        die;
    }

    public function postAction() {
        echo 'Good';
        die;
    }

}

/app/code/local/Codefire/Contacts/etc

<?xml version="1.0"?>
<config>
    <modules>
        <Codefire_Contacts>
            <version>0.1.0</version>
        </Codefire_Contacts>
    </modules>
    <frontend>
        <routers>
            <contacts>
                <args>
                    <modules>
                        <Codefire_Contacts before="Mage_Contacts">Codefire_Contacts</Codefire_Contacts>
                    </modules>
                </args>
            </contacts>
        </routers>
    </frontend>
</config>

Its not working...


texts: How to place order using REST API and stripe payment method in Magento 2

texts:
I have used ReactJS for frontend and Magento2 for the backend.

I have installed the "Stripe Payments" extension.
https://marketplace.magento.com/stripe-stripe-payments.html

How can I place the order using the REST API with 'Stripe Payment Gateway'?

REST API (PUT):  https://example.com/index.php/rest/V1/carts/mine/order

{
    "paymentMethod": {
    "method": "stripe_payments",
        "additional_data": {
            "number" : "4111111111111111",
            "exp_month" : "10",
            "exp_year" : "30",
            "cvv" : "123"
        }
    }
}

Result :

{
    "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5dc02747ba403"
}

Thanks


texts:
whenever i select more then 20 records from the filter in the magento admin customer->all customers i have seen this issue
http://prntscr.com/n73cu6
I have tried and i can revert the filter to 20 but when i click on seeing the next 20 customers i face this issue again . is there any way to fix this issue ? I have tried almost every thing every single thing from the google help all commands are done indexer,upgrade,static-content etc every thing .


texts: Product.OptionsPrice is not a constructor magento 1.9.3

texts:
I have upgrade magento 1.9.2.4 to 1.9.3.

I am facing the following error in the console in product page.

TypeError: Product.OptionsPrice is not a constructor

var optionsPrice = new Product.OptionsPrice([]);


texts: Is there any way to retain the entered customer billing/shipping addresses in magento admin once entered?

texts:
We see that the addresses of billing/shipping added to the order creation process gets erased if we remove all line items from the cart and then add back new product using "Add products by SKU" button.

This feature is only on the enterprise edition of Magento 2.2.6

Can anyone guide us on this?


texts: Pincode to check shipping serviceability in the product page magento?

texts: Is there any extension or way to implement the  pincode(zipcode) to check shipping serviceability in product page because most of the courier services not  giving service to all the areas, So customer can check service availability to their area at product page itself,


texts: Show items of checkout car in other page

texts:
I want to get items that added to checkout car and show that/those in other page in a specific div.

Items that I want to show like below image:

I just want the box that show product with price and I don't need to show Total.

I also test this code but it doesn't work:

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
$productName = $item->getProduct()->getName();
$productPrice = $item->getProduct()->getPrice();
}

How can I do this?

UPDATED:

And also Ii want when I remove a product from this div it is remove from checkout cart too.

Thanks For Helping me.


texts: Overriding template file from custom module not working

texts:
i want to override block phtml file for customer address edit, first i created the customer_account_edit.xml at Namespace/Moduke/view/frontend/layout/ :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
      <referenceBlock name="customer_edit">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Namespace_Module::customer_address_edit.phtml</argument>
        </action>
      </referenceBlock>
    </body>
</page>

then i created the phtml file located at  Namespace/Module/view/frontend/templates/customer_address_edit.phtml

but it still load the vendor phtml file, not the one i made


texts: Magento 2 - update the various types of quantities with each click on the color

texts:
On my configurable product there are obviously all the color variations and with each click the product image changes.
What I would like to do is to be able to take the various quantity values for the color that I click on. For example: If I click on the red color I will have the image produced by the red color and its qty, qty2, qty3 value printed somewhere on the page.
Is it possible to take this value with Ajax?


texts: How to Get Order Redeemed Reward Points and Earned Rewards Points on order_new.html page Email template Magneto 2.3.4

texts:
I want Reward Redeemed and and Earned Points in order_new.html Email template page in Total section and E Gift Card Reedemed Data also required. For that I Overide this file in my theme:

/var/www/html/aldo/app/design/frontend/vendor/theme/Magento_Sales/email/order_new.html

  /var/www/html/magento/app/design/frontend/<vendor>/<theme>/Magento_Sales/templates/order/totals.phtml.

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var $block \Magento\Sales\Block\Order\Totals
 * @see \Magento\Sales\Block\Order\Totals
 */
$_totals = $block->getTotals();
$_order = $block->getOrder();
$demoData = "";
?>

        <?= /* @escapeNotVerified */  __('Promo Discount') ?>
          <?= /* @escapeNotVerified */  $_order->getBaseDiscountAmount() ?>

        <?= /* @escapeNotVerified */  __('Shipping') ?>
        <?= /* @escapeNotVerified */  $_order->getShippingAmount() ?>

        <?= /* @escapeNotVerified */  __('Subtotal') ?>
          <?= /* @escapeNotVerified */  $_order->getSubtotal() ?>

s

        <?= /* @escapeNotVerified */  __('GST incl') ?>
          <?= /* @escapeNotVerified */  $_order->getTaxAmount() ?>

        <?= /* @escapeNotVerified */  __('e-Gift Card Redeemed') ?>
          <?= /* @escapeNotVerified */ $demoData   ?>

        <?= /* @escapeNotVerified */  __('Points Earned') ?>
        <?= /* @escapeNotVerified */  $demoData ?>

        <?= /* @escapeNotVerified */  __('Points Redeemed') ?>
          <?= /* @escapeNotVerified */  $demoData ?>

        <?= /* @escapeNotVerified */  __('Total') ?>
        <?= /* @escapeNotVerified */  $_order->getGrandTotal() ?>


texts: Issue with implementing Ajax Buy Now button to Magento List.phtml

texts:
I am trying to add a "Buy now" button to the category page of my store. I have followed the following guide;

http://www.ifuelinteractive.com/jquery-magento-and-ajax-add-to-cart-redux/

Making a few changes to the layout of the form. I can see that my values are getting into the PHP script, and if I ouput debug points in the PHP, it gets as far as;

  $cart->addProduct($product, $qty);

And this causes the exception "The product could not be found" to appear in the console. I can check the logs and see that this exception is coming from core/mage/checkout/model/cart.php which does indeed contain the exception, and is throwing it when...

    $currentWebsiteId = Mage::app()->getStore()->getWebsiteId();
    if (!$product
        || !$product->getId()
        || !is_array($product->getWebsiteIds())
        || !in_array($currentWebsiteId, $product->getWebsiteIds())
    ) {
        Mage::throwException(Mage::helper('checkout')->__('The product could not be found.'));
    }
    return $product;

I then output getWebsiteIds() of $product in the addToCart.php file that is being loaded in via Ajax and the array is empty. Leading me to believe that the exception is being thrown because the php file is unable to pick up the website IDs associated with the product.

I should mention that I am using Organic Internet Simple Configurable Products - and configurable products are used on the list.phtml category, however simple product IDs are loaded into the Ajax script via a dropdown menu, and these are getting loaded into the addToCart.php file correctly (I can see via debuging). On Magento V 1.12

Thanks in advance


texts: Product saving very slow (takes minutes)

texts:
For several days my backend takes minutes for saving and generating products.

I have this message in my logs :

[2019-05-13 08:25:06] main.CRITICAL: Read timed out after 10 seconds {"method":"POST","url":"http://XXX/admin/catalog/product/save/type/simple/store/0/set/4/key/3f8d5c232e1008b42d7776c86bae57cbc8d6da89081040a13e0e01b667a45deb/back/edit","invalidateInfo":{"server":"[object] (Zend\\Uri\\Uri: http://localhost:6082/)","tagsPattern":"((^|,)cat_p_1168(,|$))"}} []

I'm on magento 2.2.5

PS : I'm using varnish cache.

I have this error after a few minutes :

  Error 503 Backend fetch failed

  Backend fetch failed Guru Meditation:

  XID: 1742759

  Varnish cache server

Anone facing the same issue ?


texts: What is the difference between adding CMS Static Block into CMS Page Content & Design?

texts: What is the difference between adding CMS Static Block into CMS Page -> Content and  CMS Page -> Design?


texts:
I have used the following script in a .phtml file

      require([
        'jquery'

], function ($) {
    $('#update-shipping-method-submit').trigger('click');

});

My issue is after loading of page is keeps on clicking & reloading, I want to click this id only once after page load.


texts: Magento 2 - not able to find some functions

texts:
I was working on the shipping part, but I found that some functions' declaration can not be found in the code repository. For example, in the 1000th line of

  app/code/Magento/Quote/Model/Quote/Address.php

$shippingRates = $result->getAllRates();

https://github.com/magento/magento2/blob/6ea7d2d85cded3fa0fbcf4e7aa0dcd4edbf568a6/app/code/Magento/Quote/Model/Quote/Address.php#L1000

I searched the whole mangento 2 repository, but I could not find something like

public function getAllRates(){ //....}

Is there any mechanism in Magento 2 that will auto generate functions?


texts:
I've read several threads about this, but still can't resolve the issue.

We use apache + PHP-FPM. In Magento tree files are owned by apache-user:dev. Now, using 775 / 664 for dirs and files. Also, we disabled redis and using files for backend cache.

When I clear / flush cache in backend, most files get written in magento-dir/var/cache as usual, but I noticed some files are written in system /tmp (not in /tmp/magento). Actually, 14 files with "Locale" serialized data:

zend_cache---internal-metadatas...

zend_cache---Zend_LocaleC...

zend_cache---Zend_LocaleL...

That is, some files get written correctly in var/cache and others in system /tmp directory.

Running scripts in magento root to get system var dir:

<?php
echo sys_get_temp_dir();
?>

returns /tmp

and magento var:

<?php

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$var_dir = Mage::getModel('core/config')->getVarDir();
echo $var_dir;

Returns magento-dir/var, as expected.

Also, permissions seem correct, since most files get written properly.

Anyone with this behavior?


texts: Magento 2 Notice: Undefined variable: images

texts:
I use custom variable in Mirasvit Extension for export parent images also from variants.
For test I export single product and working correct. Now I set filter with export all configurable products in website and I get issue:
Notice: Undefined variable: images in /home/azinvest/domains/under.pl/public_html/pub/media/feed/tmp/16110634559723.php on line 14

On line 14 custom variable  is:
 }
    $images = implode(', ', $images);
}

Here is full code dynamic variable.
$storeManager = $objectManager->create('\Magento\Store\Model\StoreManagerInterface');
$mediaUrl = $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
if ($product->getTypeId() != 'configurable') {
$images = $mediaUrl . 'catalog/product' . $product->getImage();
} else {
    $children = $product->getTypeInstance()->getUsedProducts($product);
    foreach ($children as $child){
        if ($child->getMediaGalleryImages()) {
            foreach ($child->getMediaGalleryImages() as $image) {
    $images[] = $mediaUrl . 'catalog/product' . $image['file'];
            }
        }
}
    $images = implode(', ', $images);
}
return  $images;

Any solution?


texts: Magento 2: "Back" Link from View Order to Custom Grid

texts:
I have a custom sales order grid that has a "view" link for each entry which takes the user to the standard Order View page.
Is there a way to make the "Back" link on the order view page go back to my custom grid, instead of the default Sales Order Grid?
EDIT: I still have the regular Sales Order Grid as well, so I need the link to return to whichever grid the user came from.


texts: Set Base Image, Small and Thumbnail to configurable products while images are already uploaded but not assigned

texts:
I have lots of configurable products. Everything is working fine but the issue with product images. I have uploaded images to every configurable product but I forget to assign them as Base Image , Small Images, Thumbnail so that images are not visible to the frontend.

Could anyone please suggest me any easy way to assign images programmatically or any other way rather than assigning each image from admin panel because there are lots of configurable products?

UPDATE

I am trying to import the following CSV file to make images selected but still no success CSV FILE

Thank You!


texts: Site still vulnerable to APPSEC-1213 after installing SUPEE-7405

texts:
I installed SUPEE-7405 and everything appeared to go smoothly with no errors, however I tested out the exploit described here and to my horror the site still allows me to create an account with an email address like:

"<script>alert(1);</script>"@example.com

I would assume that whatever file was changed to fix APPSEC-1213 is being overridden by an extension somewhere, but how can I even find out what file was changed to fix APPSEC-1213?


texts: Bundle products - get default title for a bundle item

texts:
I have created a new template for bundle products(instead of standard view.phtml)
How can I display the titles of bundle items?


texts: Magento 2 - How to call custom (Self Created) module in home page?

texts:
I have created a custom module with view using (Block, Layouts and Templates), its working fine with the url(http://hostname/modulename/index/test) but need to call it in home page. I mean when home page loaded, module should be rendering in home page in specific area with following fields (Name, age-group, gender etc.). And also have to save these fields values in database.

Steps followed during creation of module without view :

Step 1: Created the Namespace(CompanyName) and module(HelloWorld) folder

Step 2: Created etc/module.xml file

Step 3: Created etc/registration.php file

Step 4: Created etc/frontend/routes.xml file

Step 5: Created Controller/Index/Display.php

Steps followed during creation of module with view :

Step 1: Created layout - view/frontend/layout/helloworld_index_display.xml

Step 2: Created block - app/code/CompanyName/HelloWorld/Block/Display.php

Step 3: Created template file - app/code/CompanyName/HelloWorld/view/frontend/templates/sayhello.phtml

Everything is working fine just I have to render sayhello.phtml file in Homepage area. How I can do this?

Thanks.


texts:
I was trying to install an extension to our magento store using 'Magento Downloader' but I got the following error message:

  Your Magento folder does not have sufficient write permissions, which downloader requires.

As I was browsing the web for a solution one of them was to temporary set your httpdocs or 'public html' folder to '777' however upon doing this, it has now taken our website offline which you can see here: giving a "503 Service Unavailable" error and showing a Magento error page:

  Service Temporarily Unavailable
  The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

How can I fix this? I tried setting the permissions back to the original ones but the same page still displays with "Service Temporarily Unavailable".


texts: set related/upsell products programatically only works for 1 product

texts:
I am trying to update products programatically and I'm having issues with the related/upsell section.

It updates only with the last product sku. So if I am trying to link 3 products with a parent one as in the example below, only the last one will appear in the related section for product parent_sku.

$linkDataAll = [];
$skuLinks = "9780500420584,9780500544679,9780500650936";
$skuLinks = explode(",",$skuLinks);

foreach($skuLinks as $skuLink) {
  //check first that the product exist
  $linkedProduct = $this->productFactory->create()->loadByAttribute("sku",$skuLink);
  if($linkedProduct) {
    $linkData = $this->productLinks //Magento\Catalog\Api\Data\ProductLinkInterface
                    ->setSku("parent_sku")
                    ->setLinkedProductSku($skuLink)
                    ->setLinkType("related");
    $linkDataAll[] = $linkData;
  }

}
if($linkDataAll) {
  print(count($linkDataAll)); //gives 3
  $product->setProductLinks($linkDataAll);
}
$product->save();


texts: Magento 2 : How to Copy whole admin panel in custom route

texts:
I want to create the whole admin panel in my custom route, like
here is the default method is 192.168.1.57/magento/admin to
192.168.1.57/magento/demoroute with all the functionalities of admin.


texts:
I'm having an issue trying to use DHL plugin in Magento 1.9.

I have introduced all the fields with the DHL information but when I'm trying to buy an item it says:

  "This shipping method is currently unavailable. If you would like to
  ship using this shipping method, please contact us."

I've found that I need to switch from Test mode to Live mode but I can't find where I can do that (I'm using production URLs given by DHL).

Regards.


texts:
how to add store manager user in magento2 multi-store so that particular manager/user can view and/or manage own store related settings ?

Store name     |   Store admin
Main store     |   Admin@MainStore
Store 1        |   Admin@Store1
Store 2        |   Admin@Store2

Only Admin@MainStore can change global settings where Admin@Store1 and Admin@Store2 would change settings related to their own stores Store1 and Store2 respectively


texts: Removing multiple currencies in Magento 2

texts:
How I can remove my another currency in the admin? I have one website, one store and one view, but into frontend still has two currencies.

The cache and varnish is disabled, is in developer mode.


texts: Magento 2 : How to Use Custom AJAX Code in Admin Front End

texts: I'm developing a delivery system for handling parcels that are handled the delivery agents. since I'm a open cart developer and new to magento, its hard for me to develop. Kindly tell me how to add and use my custom AJAX js directly in a needed place. I need how to access the database from controller.


texts: What is the purpose of the view/base in magento2 modules ?


texts: magento 2.3.4 Errors after moving site to live domain within the same server [SOLVED]

texts:
I have created a magento 2.3.4 site on a test server var/www/domain.es/developer/
Once the site is tested and working I have changed the location by plesk (copy site) to var/www/domain.es but what is my surprise when I check the following

1) When I do an export I save it in var/www/domain.es/developer/var/export

2) The files .update_status.txt .update_cronjob_status .setup_cronjob_status are still updated in var/www/domain.es/developer/ and do not exist in var/www/domain.es

3) In the DB cron_schedule.sales_clean_orders continues searching in var/www/domain.es/developer/ and gives error Notice: Undefined index: simple_sku in /var/www/vhosts/domain.es/developer/vendor/magento/module-inventory-configurable-product/Plugin/Sales/GetSkuFromOrderItem.php on line 36

And more things that are possibly all related.

Any help in solving this?


texts: Extending class not working unless you copy all methods

texts:
In my module I want to overwrite the method
public function collect(Mage_Sales_Model_Quote_Address $address) in
Mage_Sales_Model_Quote_Address_Total_Abstract.

If I copy only that method in my class:

class Company_Module_SalesRule_Model_Quote_Discount extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
  public function collect(Mage_Sales_Model_Quote_Address $address)
   {
       parent::collect($address);
       $quote = $address->getQuote();
       $store = Mage::app()->getStore($quote->getStoreId());
       $this->_calculator->reset($address);

I get:

Call to a member function reset() on a non-object

If I copy all other methods and variables from that file it will work.

I wonder why is that when you're extending a class.

In config.xml:

<models>
            <Module>
                <class>Company_Module_Model</class>
            </Module>
            <salesrule>
                <rewrite>
                    <quote_discount>Company_Module_SalesRule_Model_Quote_Discount</quote_discount>
                </rewrite>
            </salesrule>
        </models>


texts: How to run a Cron on particular button click on Magento 2?

texts:
I want to run a Cron on particular button click which I have to create in Magento Backend.
Basically i want to run cron when i click that button and it will take some data from a txt file and create a new product in Magento 2.
Or any other any because if the txt file has so much product then it will hung up the Magento Panel if i create that from admin side so my idea is to run that in background any idea of doing that.
My Csv file
col1    col2    col3
abc     123     xyz
abc     234     xyz
abc     456     xyz
abc     789     xyz
def     567     xyz
def     223     xyz

**now i have added only some rows from csv now i have to created product name like ex: abc-123-xyz like this name.
I have get the name of the product like this from csv file in a controller but if my csv has 1000 rows then the controller took very long time to do that.
How to achieve that or should i use controller ?**
Any help is appreciated.


texts: Add an object as a New Customer Attribute

texts:
I'm currently running Magento ver. 1.7.0.2

I want to add a custom attribute called memberDays to all customers.
The catch is I want it to be an associative array or object.

1.)What is the best practice to do this? (My attempted code is below)
2.)Where should this go so that it is not on my front-end.
If you could explain why also, it would be much appreciated I love learning new stuff everyday ^_^

Ex. (What I want customers to have as an attribute)

memberDays = {
    Silver => 0,
    Gold => 0,
    Platinum => 0
}

I've only been successful in changing attributes for both Products and Customers as well as adding Product Attributes in the backend Admin Panel.  Unfortunately you can't add customer attributes in the Admin panel so I'm here requesting your help!

$installer = $this;
$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('customer');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$setup->addAttribute('customer', 'member_days', array(
    'input'         => 'text',
    'type'          => 'string',
    'label'         => 'Days Remaining for Membership',
    'visible'       => 1,
    'required'      => 0,
    'user_defined' => 0,
    'membership_array' => (Silver => 0, Gold => 0, Platinum => 0)
));

$setup->addAttributeToGroup(
 $entityTypeId,
 $attributeSetId,
 $attributeGroupId,
 'member_days',
 '999'  //Place this as Last Attribute
);

$setup->endSetup();


texts:
I stuck trying to set homepage link to logo in
app/design/frontend/Mgs/claue/Magento_theme/templates/html/header.phtml
    <?php $logo = $block->getChildHtml('logo'); //Logo ?>
    ...
    <div class="col-md-4 col-sm-4 logo-header mobile-item-col">
        <?php echo $logo ?>
    </div>

probably in earlier Magento versions it was possibility set in
different way and that is why I couldn't find good answer
app/design/frontend/Mgs/claue/Magento_theme/layouts/default.xml
<block class="Magento\Theme\Block\Html\Header\Logo" name="logo">
    <arguments>
        <argument name="logo_img_width" xsi:type="number">189</argument>
        <argument name="logo_img_height" xsi:type="number">64</argument>
     </arguments>
</block>

I couldn't find logo.phtml anywhere as well
so summarise logo is set and is showing in header but I don't know how to add link to it
any ideas how it should be done ?
many thanks for your help


texts: How to make some parameters editable via admin

texts:
I created a module that looks like this:

http://screencast.com/t/TG7brmUi

And the code looks like this:

he code is as follows:

Luisvalencia_Affiliate.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Luisvalencia_Affiliate>
            <active>true</active>
            <codePool>community</codePool>
        </Luisvalencia_Affiliate>
    </modules>
</config>
config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Luisvalencia_Affiliate>
            <version>0.0.1</version>
        </Luisvalencia_Affiliate>
    </modules>
    <frontend>
        <events>
            <controller_action_predispatch>
                <observers>
                    <luisvalencia_affiliate>
                        <class>luisvalencia_affiliate/observer</class>
                        <method>captureReferral</method>
                        <type>singleton</type>
                    </luisvalencia_affiliate>
                </observers>
            </controller_action_predispatch>
        </events>
    </frontend>
</config>
and Observer.php

<?php
class Luisvalencia_Affiliate_Model_Observer
{
    const COOKIE_KEY_SOURCE = 'luisvalencia_affiliate_source';

    public function captureReferral(Varien_Event_Observer $observer)
    {
       //bla bla bla, get cookie value from admin?
    }

    protected function _getCookieLifetime()
    {
        $days = 1;
        // convert to seconds
        return (int)86400 * $days;
    }
}

As you can see the cookie lifetime is hardcoded.

I would like to add an admin section on the magento backend to be able to edit the cookie lifetime for example.

can you please guide me?


texts: Change billing information order Company name to be first

texts:
I want to get the company name up to the first place (see image) for the delivery address at the email that comes after buying something. Do anyone of you guys know where I can find the file for this? im using magento 1.9.2

Thanks :)


texts: Magento marketplace with centralized fulfillment

texts:
I'm new to Magento (while experienced in PHP and several frameworks) and I was asked to build a marketplace site. Mostly Amazon like.
That is, several vendors publishing their stuff for sale while all the order management (fulfilling, shipping, etc) is managed by the marketplace owner.
I saw several extensions that provide pretty much of the functionality but all of them seem to let the particular vendor manage the order and fulfillment.
Can I get some advise on an ecosystem of packages that would let me do that?
Any advise is welcome.
Thanks in advance.


texts:
http://www.awesomescreenshot.com/image/1772552/f53fba11334071f01cf363db363c9e9a
magento talking two much time on zero installation, 500 error is showing in console. I have every thing php7 and mysql 5.6 and all thing, 2.3 gb ram with vps server but not able to  please help me.


texts:
I'm using Magento 1.9.1
I wondering whether can I add name of image(file's name) to image menu ?
I need to double check my images with specific color and i can verify them only by file name so if i could add title on that menu which is showing my file names will be great.


texts: Magento 2, how to get a widget to update immediately?

texts:
So I've created a widget, and I noticed that the products were not updating as frequently as I wanted. So I re-created the widget within the same block. However, even after re-indexing, and re-processing my entire cache, the modified Widget doesn't actually display anything until, what seems to be 24 hours after modification.

I cannot figure out why.


texts: magento 2 - multistore - single invoice system

texts:
I've just setup a working multistore website.

If someone orders an item from the us-version of the website, #0000001 will be designated as the invoice number.

But if someone else orders something from the spanish site, #2000001 will be designated.

How can I change this so that the all new orders will be #0000002, #0000003, etc instead of #2000001, etc.


texts:
I need to add top links via extension.i accomplish it.but it create wrong url.

<default>
    <reference name="root">
        <reference name="top.links">
            <action method="addLink" translate="label title">
                <label>Events</label>
                <url>/myextension/index/eventcalender</url>
                <title>Events</title>
                <prepare/>
                <urlParams/>
                <position>10</position>
            </action>
        </reference>
    <default>

its adding new top links as events. but problam is it not create correct url

its create http://127.0.0.1:8080/myextension/index/eventcalender

instead of http://127.0.0.1:8080/myextension/index.php/index/eventcalender
yes I know i can simply solve that  changing

<url>/myextension/index/eventcalender</url>   to

 <url>index.php/myextension/index/eventcalender</url>

but when i go to
http://127.0.0.1:8080/myextension/index.php/index/eventcalender

it works correct but i click  top link by staging

http://127.0.0.1:8080/myextension/index.php/index/eventcalender

index.php/index/eventcalender part   append again  to link

http://127.0.0.1:8080/myextension/index.php/index/eventcalender/index.php/index/eventcalender/

and give 404 error
so i need to know correct way to give link within xml file above


texts: Magento 2 - Disable Quantity for particular products on Multishipping checkout

texts: I want to disable the qty box for particular products which are free on multishipping checkout.


texts: Magento 2 Composer error when trying to install modules [UnexpectedValueException]

texts:
I'm trying to install a module with magento 2 composer. However, when I try the command:

composer require sendcloud/sendcloud

I see an error:

[UnexpectedValueException]
RecursiveDirectoryIterator::__construct(vendor/magmodules/packages): failed to open dir: No such file or directory

Earlier, I tried to install a module :

composer config repositories.magmodulesartifacts artifact vendor/magmodules/packages
composer require magmodules/GoogleShopping:1.1.4

But. that wasn't very successful. Probably, it's related with that. Then, I installed that module via FTP.

Please help me fix this error.

Thanks!


texts: How can I add the content of Block/Phtml files besides Order Total on the cart summary?


texts: Add custom option on catalog_product_new_action

texts:
I have a simple need which is that I hae a custom product type and that product needs options attached to it.  I need these options to be editable and removable so I'm going to use what is built in.  I have the observer working and the method is being fired.  When I do a var_dump($product);die();  I can search for the title of the sample custom option and find that it is apart of the output.  When I get to the new product page I am not seeing the options.  This is what I have.

public function catalog_product_new_action($observer) {
    //check that we haven't made the option already
    $product = $observer->getEvent()->getProduct();
    $options = $product->getOptions();
    if ($options){
        foreach ($options as $option) {
            if ($option['title'] == 'Auto Date & Time' && $option['type'] == 'date_time' && !$option['is_delete']) {
                //we've already added the option
                return;
            }
        }
    }
    $option = array(
        'title' => 'Auto Date & Time',
        'type' => 'date_time',
        'is_require' => 1,
        'sort_order' => 0,
        'is_delete' => '',
        'previous_type' => '',
        'previous_group' => '',
        'price' => '0.00',
        'price_type' => 'fixed',
        'sku' => ''
    );
    $product->setProductOptions(array($option));
    $product->setCanSaveCustomOptions(true);
    $product->setHasOptions(true);
    $product->save();

}

It is close, but it's not displaying on the back end.  What I don't want to do is force a user to save the product and then auto generate the options after the fact, so I'm not wanting to use any of the on saves events and why I am using that catalog_product_new_action event

Update
It is worth noting that the save ( $product->save(); ) will save an empty product but it will not be used when you are landing on the next leg of a new product after choosing the type ( admin/product/new/type/#/ ).


texts: Integrity constraint violation In table search_tmp_5fd1ff54ef7e95_91743668, while search via layernavigation with Elsatic search

texts:
Integrity constraint violation In table  search_tmp_5fd1ff54ef7e95_91743668 (which are generate dynamically), while search via layer navigation with Elsatic search
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'score' cannot be null, query was: INSERT  INTO `search_tmp_5fd1ff54ef7e95_91743668` (`entity_id`,`score`) VALUES (?, ?)

table created at : vendor/magento/framework/Search/Adapter/Mysql/TemporaryStorage.php


texts: Magento add to cart button not working 500 error display

texts: On my website when I click on the product add to cart button then its display "HTTP ERROR 500" display.


texts: SOAP V2 - Getting gift message 'To' & 'From' information from the sales order

texts:
Is it possible to gain access to the 'To' and 'From' data for a gift message from a sales order?

I'm able to get the gift message, but this is semi useless without the 'To' & 'From'.

Thanks.


texts:
I wrote code in AccountController.php for unDeleteAction function, but it is redirects to login
   protected function _unDeleteAction() {
    $this->loadLayout();
    $block = $this->getLayout()->createBlock('customer/form_login')->setTemplate('customer/account/undelete.phtml');
    $this->getResponse()->setBody($block->toHtml());
    }

But when i open this page it is opening after logged in only. Without logged in it is redirect to login page. How to do it to open this page with logged in


texts: requested product doesn't exist in backend model

texts:
I need to change product attribute value after saving it, but it gives me requested product doesn't exist when I save the product

 class myClass extends Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
 {
public function afterSave($object){
    // your after save logic

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $productRepository = $objectManager->create('\Magento\Catalog\Api\ProductRepositoryInterface');
    $product = $productRepository->getById($productId);
    $product->setName($productName);
    $productRepository->save($product);

    return parent::afterSave($object);
}


texts: How to set length of Magento\Framework\DB\Ddl\Table::TYPE_FLOAT in magento 2 custom module setup script?

texts:
I want to set length of

  TYPE::FLOAT

in my custom module installation script by using the following code.

$installer->getConnection()
      ->newTable($tableName)
      ->addColumn(
          'boxlength',
          Table::TYPE_FLOAT,
          array(),
          array(
                'nullable'  => false,
          ),
          'boxlength')

I want to set length (10,4) to insert values like 10.5555.
 But right now it is not accepting 10.5555 due to set length as (10,0).

Help needed.


texts: Magento2 Cart prices Multi Currency store

texts:
I have an online store with 3 different currencies. I fetch the prices of each product from an external web-service.

A weird thing is happening, when I switch the currency from the store, the prices of items that are already in the cart are not updated. How do I force this to be updated?

Thanks in advance you for your help !


texts: JavaScript Error (Uncaught TypeError: $.initNamespaceStorage is not a function)

texts:
We are running a Magento multi site and on ONE site only, I get this error
Uncaught TypeError: $.initNamespaceStorage is not a function
All sites use the same theme (just some differences between them..), any clues ?
Thank you for helping me
Here is the script
        require.config({
            deps: [
                'jquery',
                'mage/translate',
                'jquery/jquery-storageapi'
            ],
            callback: function ($) {
                'use strict';

                var dependencies = [],
                    versionObj;

                $.initNamespaceStorage('mage-translation-storage');
                $.initNamespaceStorage('mage-translation-file-version');
                versionObj = $.localStorage.get('mage-translation-file-version');

                 if (versionObj.version !== '92817ddfc8670bafd7f41084a570359ae57c4623') {
                    dependencies.push(
                        'text!js-translation.json'
                    );

                }

                require.config({
                    deps: dependencies,
                    callback: function (string) {
                        if (typeof string === 'string') {
                            $.mage.translate.add(JSON.parse(string));
                            $.localStorage.set('mage-translation-storage', string);
                            $.localStorage.set(
                                'mage-translation-file-version',
                                {
                                    version: '92817ddfc8670bafd7f41084a570359ae57c4623'
                                }
                            );
                        } else {
                            $.mage.translate.add($.localStorage.get('mage-translation-storage'));
                        }
                    }
                });
            }
        });


texts:
Magento Update Multiselect Attribute: add 1 option (dont overwrite curent0) via script or massupdate or extension

Situation
Product with multiselect attribute for color

 - COLOR       [Green]   [Yellow]    [Blue]    [Red]
 - Product1       x         x          x
 - Product2                            x
 - Product3                 x

We now want to update all 3 products in 1 go to be like this

 - COLOR       [Green]   [Yellow]    [Blue]    [Red]
 - Product1       x         x          x         x
 - Product2                            x         x
 - Product3                 x                    x

In this case we ADD the option RED to all 3 (and dont remove any data)

Questions:
Can this be done via a massupdate in backend? (I think it overwrites all and leaves ONLY red selected); or maybe via a script or other method?

I appreciate your help


texts: Custom product attribute to multiselect filterable magento 2

texts:
/** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'product_ingredients',
        [
            'type' => 'varchar',
            'frontend' => '',
            'label' => __('Product Ingredients'),
            'input' => 'multiselect',
            'source' => '\Vendor\Module\Model\Config\Source\Options',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'required' => false,
            'system' => false,
            'visible' => true,
            'user_defined' => false,
            'searchable' => false,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => '',
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'position' => 60,
        ]
    );

I installed this attribute and need filterable dropdown like category.
Try something like this is product_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<field name="product_ingredients">
    <argument name="data" xsi:type="array">
    <item name="options" xsi:type="object">\OpsWay\KeyIngredient\Model\Config\Source\Options</item>
        <item name="config" xsi:type="array">
            <item name="sortOrder" xsi:type="number">0</item>
            <item name="additionalClasses" xsi:type="string">admin__field-default</item>
            <item name="formElement" xsi:type="string">multiselect</item>
            <item name="source" xsi:type="string">conditions</item>
            <item name="componentType" xsi:type="string">attribute</item>
            <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
            <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
            <item name="filterOptions" xsi:type="boolean">true</item>
            <item name="showCheckbox" xsi:type="boolean">true</item>
            <item name="chipsEnabled" xsi:type="boolean">true</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="levelsVisibility" xsi:type="number">1</item>
            <item name="listens" xsi:type="array">
                <item name="newOption" xsi:type="string">toggleOptionSelected</item>
            </item>
        </item>
    </argument>
</field>
</form>

Old multiselect attribute still visible and new one not saving selected option.

Need help :)


texts: How to include a graph chart in Magento 2 admin custom module

texts: How to create a graph in my custom module in Magento 2 admin side.


texts: Magento Admin page is not loading at all

texts: My magento admin page is also not loading up but my website is loading up properly. There was a re-integration of my payment gateway been worked on at the back end. Not sure where something has gone wrong.


texts: Calculating the price based on the product size

texts:
Our client has only one product which is product dimensions vary on the customer request. The product price dependent on the product dimensions. Therefore, we must calculate the final price based on the customer request.

So, my question is how we should do such kind of thing in Magento? Is it possible to get product dimensions while customers create an order?


texts: Magento 2 custom attribute colunm in admin customer grid

texts:
I am trying to add custom attribute column in admin customer grid in Magento 2 but I got below error.

  main.CRITICAL: SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'ip_country' in 'order clause'


texts: Updating different products with different prices without any loop

texts:
i am updating different products with different prices of a specific store. Everything is working fine. But problem is, it takes too much time as i have 1000 of products.

$collection = Mage::getResourceModel('catalog/product_collection')->addStoreFilter($_primarystoreid)->addAttributeToSelect('*');
    $prod1 = Mage::getModel('catalog/product')
            ->setStoreId($_primarystoreid);
    $prod2 = Mage::getModel('catalog/product')
            ->setStoreId($_secondarystoreid);

    foreach ($collection as $product) {
        $prod1->load($product->getId());
        $actualPrice = $prod1->getPrice();
        $newPrice = ((((float) $price) / 100) * $actualPrice) + $actualPrice;
        $prod2->load($product->getId());
        $prod2->setPrice($newPrice)->getResource()->saveAttribute($prod2, 'price');
    }

So is there any way to do the same thing without any loop?Thank You


texts: Magento 2 How to set cache-lifetime for only homepage

texts: I want to set separately cache lifetime for the homepage only. Not for other pages.


texts: magento puts a random email in the cc field of transnational emails

texts:
About two days ago, i installed an extension, then have removed it. The people who made the extension say, their extension hasn't caused the problem but our customers have been contacting us to say that the email they got for their order is not theirs.
when i looked i noticed that there is a random email put in all the transnational emails.

i upgraded to magento 1.9.2.1 but it is still happening. I removed all the extension files that I have installed to no avail.

i had custom email templates, now i put everything back to the default templates and that also didn't help.

I appreciate any help.


texts: How add custom js and css to registration page in Magento 2

texts:
I created a module for Magento 2, with two files to add to the user registration page:

  app/code/MyModulespace/ModuleName/view/frontend/web/css
  /mycss.css

  app/code/MyModulespace/ModuleName/view/frontend/web/js/
  myjs.js

How can I add these two files to the user registration page?


texts: Magento WordPress Integration : Database Error

texts:
I want to integrate 'WordPress Integration' plugin.
The extenstion link is,
https://www.magentocommerce.com/magento-connect/wordpress-integration-1.html

My Magento ver. 1.9.0.0 and wordpress version is 4.6.1. I have installed this extenstion in the local magento setup but after installation I'm getting following message,

  Database Error : Error establishing a database connection. You can
  confirm your WordPress database details by opening the file
  wp-config.php, which is in your WordPress root directory.

can you please help me to resolve this error ?

Thanks


texts: Magento 2 disabling product by custom attribute

texts:
Is there a way in disabling a product by checking its custom attribute?

example scenario:
'date_expiration'
if date_expiration < today the product status will be disabled.

I have tried creating a custom front_end template for Magento_Catalog, that checks attribute date_expiration when expiration met it will redirect to homepage. I know this is not good solution because it will appear on catalog list.


texts: Currency update error when updating with currency converter api

texts:
When I try to update the currency rates with the import service Currency Converter API in Magento 2.3.0, I get an error as follows:

  Notice: Undefined index: USD_BRL in
  vendor/magento/module-directory/Model/Currency/Import/CurrencyConverterApi.php
  on line 91

When I remove a currency which it throws the error for like above, it just shows the error for the next currency in line when I click import.

Line 91 in that file is as follows: (double)$response[$currencyFrom . '_' . $to]

It is the same as the one in the file on the Magento 2 GitHub.

I searched google for a couple of hours and nothing to this comes up?

Anyone experienced this before and has a solution?

Thank you so much in advance.


texts: Error: SQLSTATE[HY000] [1049] Unknown database 'db_wire' in magento 2.2.3

texts:
I am just executing this command line on console php bin/magento setup:upgrade --keep-generated  output of this command is SQLSTATE[HY000] [1049] Unknown database 'db_wire' what should i do and following is my env.php

array (
  'default' =>
  array (
    'host' => 'localhost',
    'dbname' => 'db_wire',
    'username' => 'root',
    'password' => '',
    'active' => '1',
  ),
),

I already created database with name 'db_wire'. I create a new database still it's giving same error .Please Help me.Many thanks


texts: How do you remove the wrapping DIV from Page Builder elements?

texts:
Page builder seems to like wrapping everything in a <div> tag.  This is causing an issue especially with HTML elements which for some reason is automatically wrapped with...

<div data-content-type="html" data-appearance="default" data-element="main" style="border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;" data-decoded="true">
    ...
</div>

How do we override this to remove the wrapping <div>?


texts: EAV indexer optimization: cannot find option

texts:
There is a section in the Magento 2.3 documentation that is titled EAV indexer optimization. It says that you should basically disable the EAV indexer, if you are not using a MySQL based search function.

In our case we use FACT-Finder, so this would be relevant to us. However, in our Magento 2.3.2 instance, there is no Stores > Settings > Configuration > Catalog > Catalog > Catalog Search settings section and I cannot find the mentioned options anywhere else.

Also I am wondering: even if you do not use a MySQL search: shouldn't the EAV flat tables still be faster for product listings etc.?


texts:
If I try to print price and final_price from $_product in category page template (product/list.phtml), they have the same value despite the product is affected by a catalog rule.
Why?

How can I get the discounted price in there?


texts: Shipping cost estimation displays a wrong element

texts:
My magento version is 2.2.6.
I'm using a custom shipping module.

During the estimation of the shipping costs, it shows this weird links. The estimated price is ok but the display is not Ok.

In the checkout page, it looks better:

Where could it be the problem?

Thank you!


texts: How do i add Static files (styles and scripts) Magento 2 via AWS lightsail

texts:
Looking for some help here regarding adding styles and scripts(.css, and .js files) to a header on my page.

I know that i have to be on developer mode to do this but i don't know where i have to put my files, this is what i have done so far:

i have added it to my file tree here is the file paths....

/apps/magento/htdocs/app/design/frontend/Web/Css
/apps/magento/htdocs/app/design/frontend/Web/Js
/apps/magento/htdocs/app/design/frontend/Vendor/Theme/Magento_Theme/Layout

Am i doing anything wrong?

Please advise. Looking forward to your reply as i can't find it in my header of my page.

I have total 7 files 2 .css and 5 .js files and one default head blocks under layout (this is where i added in the src, and href to)

I think this is wrong?

  Please keep in mind that i am using Magento2 via AWS Lightsail and Lightsail ssh, along with AWS cloud 9 for file tree(as path may be different) also please note that i created a new topic due to none existing with Lightsail path

Thank you.


texts: Phpminiadmin access denied for user@root(0)

texts:
I am installing Magento-2.1.0 and for this need database.

I have added phpminiadmin on root, now accessing with the correct username and password still showing error.


texts: Add filter toolbar to advanecd search page

texts:
How I can add filter toolbar to advanced search page.
I created catalog_category_view.xml and added the XML below but it does not change the template.

<referenceBlock name="product_list_toolbar">
    <block class="Plumrocket\ProductFilter\Block\Html\Pager" name="product_list_toolbar_pager"/>
</referenceBlock>
<referenceBlock name="search_result_list">
    <container name="category.product.list.additional" as="additional" />
</referenceBlock>


texts: Multiple currency symbol positions within a single locale

texts:
I've seen several articles that talk about changing the currency symbol position in the locale xml file. However, this seems to change the position for every type of currency, which is not ideal for a store that supports multiple currencies. It seems like currency positioning would be split out into its own configuration, not tied to locale.

How do I change the currency symbol position for specific currency types?


texts: Optimize product images before uploading?

texts: I'm using the Magento Store in version 1.7.0.2. I have a question about the product images. Is it necessary to optimize the product images before uploading or does optimize Magento the corresponding image sizes depending on the application screen size automatically?


texts: Order email not sending, I'm being asked to edit my crontab but I don't know how

texts:
I have a problem with the Order Confirmation emails not sending, all the others appear to be sending just not the Order confirmation ones.

I've installed AOE scheduler, and it's indicating that there is No Heartbeat task found and asks that I edit my cronab

sudo crontab -u new2magento -e

and add the following configuration

 * * * * * ! test -e /home/new2magento/public_html/maintenance.flag && /bin/bash /home/new2magento/public_html/scheduler_cron.sh --mode always
* * * * * ! test -e /home/new2magento/public_html/maintenance.flag && /bin/bash /home/new2magento/public_html/scheduler_cron.sh --mode default

I'm fairly new to magento and could really do with some help finding exactly where I have to add the configuration


texts: How to replace the Standard Magento "Missing/No Image" Graphic

texts:
I want to globally use my own graphic image if my client does not upload a product photo. How can I best replace the standard Magento graphic with my own custom graphic?

Backend? CSS?

Thanks.


texts: internet explorer - Are you sure you want to leave this page message

texts:
My site on internet explorer throws up the following popup every time you try and click a link to a new page.

Are you sure you want to leave this page?
Message from webpage:
null

Any ideas how to fix this?


texts:
When entering increasing the amount of products in the cart, so the stock will be exceeded, the cart is displaying wrong prices.

This happens with simple products.

How can I solve this?


texts: Does it make sense to use Magento as a backend for custom mobile apps? What is the speed of the API? Would I be able to use build in billing (at least use it to send invoices for example)? How about client records? Can I authorize clients with Magento API and store their details in Magento controlled database?


texts:
Is there a way to configure from admin panel a static block to be shown only in mobile view? I want to add a static block "install our mobile application". This block should be seen only by users who access my website from a mobile device.

Thank you!


texts: Regarding Magento 2.1.7 "Service Temporarily Unavailable" error

texts:
Problem is it does not take me to the admin panel. When I go to Magento through localhost it shows error message "Service Temporarily Unavailable".

Magento 2.1.7 is successfully installed on the database and I added Magento to the htdocs folder on Mac.


texts:
I am developing a Magento 2.1.2 shop based on the Bootstrap library.
But the Bootstrap library should only get included in cms pages. So I added the following code in the file Magento_Cms/layout/cms_page_view.xml:

<head>
  <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" src_type="url" />
  <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" src_type="url" />
</head>

The problem is, that the bootstrap CSS file gets included after the styles-l.css and styles-m.css files (shoud get included before).
So I did a bit of research in the web. The often recomended way to order files with the order="x" tag does not work.
This just does nothing:

<link  rel="stylesheet" type="text/css"  media="all" href="http://domain.tld/static/_cache/merged/f20819a53f99bb909d9eb94305d9b4e9.css" />
<link  rel="stylesheet" type="text/css"  order="3" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" order="4" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/styles-l.css" />
<link  rel="stylesheet" type="text/css"  media="print" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/print.css" />
<link  rel="stylesheet" type="text/css"  order="1" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link  rel="stylesheet" type="text/css"  order="2" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" />

Like you can see, the order tag does not work., just like the "data-order" tag.

Does anyone know how to do that the right way?

It should just be like:

<link  rel="stylesheet" type="text/css"  media="all" href="http://domain.tld/static/_cache/merged/f20819a53f99bb909d9eb94305d9b4e9.css" />
<link  rel="stylesheet" type="text/css"  order="1" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link  rel="stylesheet" type="text/css"  order="2" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" />
<link  rel="stylesheet" type="text/css"  order="3" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" order="4" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/styles-l.css" />
<link  rel="stylesheet" type="text/css"  media="print" href="http://domain.tld/static/frontend/[A]/[B]/de_DE/css/print.css" />

Do nobody else have this problem? There have to be a way im Magento 2 to do that?


texts: Talk to Magento 2 REST API using Order Increment ID

texts:
Is it possible to use the Order Increment on REST Endpoints in Magento 2 or do I have to call

https://example.com/rest/storeview/V1/orders?searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=increment_id&searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=1000000001

or something similar before hand and read the entity_id field, in case I do only have the increment_id


texts: How do I redirect user customer to the page he/she was before a log in success?

texts:
I'm using Magento 1.4.1.1

Only logged in customer can access a couple of pages of my website.
So, when a non-logged in customer tries to access a page that needs him/her to be logged in,  he/she is redirected to the login page. Using the following code.

if(!$this->helper('customer')->isLoggedIn())
{
    Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account'));
}

After login success the customer is redirected to his/her account panel (the previous page location is lost).

Is there any way to make magento go back to the page where the customer was, after login succes ?

Regards


texts: Magento2.1 - How to make a discout coupon with free shipping included?

texts:
Did someone find out how to give discount AND free shipping with a coupon code?
I couldn't create such a price cart rule. It always was either discount or free shipping.


texts: After Upgrate Magento 2 from version 2.2.5 to 2.3.4 Integrity constraint violation: 1452 Cannot add or update a child row

texts:
I am trying to upgrade Magento 2 version from 2.2.5 to 2.3.4 using CLI.
Version up-gradation is done. After version upgrade when I run bin/magento setup:upgrade it will give an error as follow:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (wheels_financing_live.#sql-4a3_9e8, CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE), query was: ALTER TABLE catalog_product_entity_decimal MODIFY COLUMN value decimal(20, 6)  NULL  COMMENT "Value", ADD CONSTRAINT CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id) REFERENCES eav_attribute (attribute_id)  ON DELETE CASCADE, ADD CONSTRAINT CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id)  ON DELETE CASCADE, ADD CONSTRAINT CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id)  ON DELETE CASCADE

Here wheels_financing_live is my DB name.


texts: Magento 2 - bin/magento not working after update to magento 2.4.1

texts:
I just updated my magento from 2.4.0 to 2.4.1 via composer.
But now bin/magento does not work anymore. If I execute php bin/magento list then nothing happens.
I figured out that a error_log file was created in the bin/ folder where the magento file is located.
It has this content:
[02-Dec-2020 14:05:30 UTC] PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Theme\Model\Theme\StoreThemesResolverInterface in /home/company/redesign.company.de/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /home/company/redesign.company.de/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Theme\\M...')
#1 /home/company/redesign.company.de/vendor/magento/module-theme/Model/Config/Customization.php(75): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Theme\\M...')
#2 /home/company/redesign.company.de/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Theme\Model\Config\Customization->__construct(Object(Magento\Store\Model\StoreManager\Interceptor), Object(Magento\Theme\Model\View\Design\Proxy), Object(Magento\Theme\Model\Theme\ThemeProvider), NULL)
#3 /home/company/redesign.company.de/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(6 in /home/company/redesign.company.de/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50


texts: Sorting product collection attribute wise

texts:
I am displaying products from collection.

There are different attributes assigned to different products.

Here is my code:

    $collection =  Mage::getResourceModel('catalog/product_collection')
  ->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
  ->addAttributeToFilter('category_id', array('IN' => array($category))) ->addAttributeToSelect('*');

 foreach ($collection as $_product)
            {
                 .....
            }

Here above $category is category id.

There are 2 attributes. consider A and B.

Now my problem is.. I want to display products with attribute 'A' first.. then products with attribute 'B' and then remaining products will be displayed.
I have tried.

$collection->addAttributeToSort('A', 'DESC');

But it is not working.

Can anyone help me?

Your help will be highly appreciated.


texts: Why magento use resource and mysql4 model collection?

texts:
What is the purpose of using these two models collection.

Resource
Mysql4

why can't we use resource model for all collections.

Why we are using MySql4 collection for simple module

Some one explain.