texts: Magento 2 - Replacing an injected argument via constructor throws an error

texts:
I am trying to replace an argument via configuration file (di.xml)that's been injected in constructor but it throws an error. Any help will be appreciated

  Fatal error: Uncaught TypeError: Argument 1 passed to Mage2\VirtualTypes\Model\Device::__construct() must be an instance of Mage2\VirtualTypes\Model\Apple, instance of Mage2\VirtualTypes\Model\Android given, called in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/html/app/code/Mage2/VirtualTypes/Model/Device.php:15
  Stack trace:

I removed var/generation, var/di and var/cache folders but it doesn't help. Here is my code sample

class Device implements DeviceInterface
{
    /**
     * @var Apple
     */
    protected $apple;

    /**
     * Device constructor.
     * @param Apple $apple
     */
    public function __construct(Apple $apple)
    {
        $this->apple = $apple;
    }
}

di.xml file

<type name="Mage2\VirtualTypes\Model\Device">
        <arguments>
            <argument name="apple" xsi:type="object">Mage2\VirtualTypes\Model\Android</argument>
        </arguments>
    </type>

And Android class looks like

class Android
{
    /**
     * @var AndroidList
     */
    protected $androidList;

    /**
     * Android constructor.
     * @param AndroidList $androidList
     */
    public function __construct(AndroidList $androidList)
    {
        $this->androidList = $androidList;
    }
}


texts: How to add custom field in custom module form like a tier price in product

texts:
I want to add new field same like tier price field in another custom module form.
Can anyone help me for this?

See i want below field


texts: Magento2 Add dropdown option in product listing page for configurable product

texts:
I want to change text-swatch to dropdown in category page.
I want here drop down instead swatch


texts: How to make invoice PDF file size compress in magento 2

texts:
I'm trying to make compress invoice PDF file size. How to make this in Magento 2.2.5. Default PDF size is 3.2MB

I'm trying to make this in between 19KB. How to make this?

I tried below link's solution but my PDF reduce to 800kb. Not able to do make it 19kb. Here is the link I tried.

Reduce PDF file size in magento

How to add custom font also? There is two type of font I found in Magento 2.2.5 setup. But no hope by them.

Please help anybody. I tried lot, but unable to do this.


texts: Edit Magento product view container position

texts:
I am trying to move the Select size drop-down under quantity box, what file do I need to edit? already tried view.phtml(/products)
Thanks in advance for help

in my add to addtocart.phtml I have only
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<?php if($_product->isSaleable()): ?>

        <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>
        <?php echo $this->getChildHtml('', true, true) ?>

<?php endif; ?>

I have uploaded  the view.phtml here


texts: Magento 2.3.6: Order email is sending but Customer Account create/forgot password email not sending?

texts:
We have checked order email is sending proper,when we tried to create new customer or forgot password that time email is not getting. when we have checked in exception.log file we have got the below error.
main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Unable to send mail: Unknown error at /vendor/magento/module-email/Model/Transport.php:103, Laminas\\Mail\\Transport\\Exception\\RuntimeException(code: 0): Unable to send mail: Unknown error at /vendor/laminas/laminas-mail/src/Transport/Sendmail.php:304)"} []

Thank's in Advance,


texts: Some Categories are Showing up All Products - How to Fix This?

texts:
This is the display setting of one of a category that is listing all products instead of showing only products that are assigned to it.

Display Mode = Products Only
CMS Block = Please select a static block ...
Is Anchor = No

edit:

Category Products tab has only 1 product assigned to it.

edit2:

this is the code that is showing all the products:
(app/design/frontend/base/default/template/catalog/category/view.phtml)

<?php
//echo $_category->getId();
$_cat = new Mage_Catalog_Block_Navigation();
$curent_cat = $_cat->getCurrentCategory();
$curent_cat_id = $curent_cat->getId();
$parentId=Mage::getModel('catalog/category')->load($curent_cat_id)->getParentId();

$categoryid = $parentId;//$_category->getId();

$category = new Mage_Catalog_Model_Category();
$category->load($categoryid);
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');

//echo "
";print_r($collection);echo "
"; die();

$i=0; foreach ($collection as $_product) { ?>
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
<a href="<?php echo $_product->getProductUrl(); ?>"><img class="product-image" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" alt="" />
<a href="<?php echo $_product->getProductUrl(); ?>"><?php echo $_product->getName(); ?>

<?php echo $this->getPriceHtml($_product, true) ?>

                    <?php if($_product->isSaleable()): ?>
                        <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>
                    <?php else: ?>

<?php echo $this->__('Out of stock') ?>

                    <?php endif; ?>

                        <?php if ($this->helper('wishlist')->isAllow()) : ?>

<a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>

                        <?php endif; ?>
                        <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>

| <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?>

                        <?php endif; ?>

<?php $i++; } ?>

<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>

        <?php echo $this->getToolbarHtml() ?>

<?php endif ?>


texts: Magento2 : How to create request a quote and edit the price in cart page?

texts: I am a beginner for Magento 2, Now I have to edit the price in cart page. I am struggling to start this. Anyone have an idea for that?


texts: Multi Vendor / Multi Seller store in Magento 2

texts: Can the new Magento 2 be able to implement these features easily ?? especially the multiple shops for each shopkeeper ? or a lot of customization will have to be done ?


texts: How magento 2.3 generates swatch images?

texts:
I want to resize default generated swatch images but upon doing that swatch images get blurred. So my question is, how to resize Magento swatch so that it will look nice? I have tried modifying background-size in swatch-renderer.js from initial to  50% 50% !important. Here is the code for your reference from swatch-renderer.js

if (type === 2) {
      // Image
      $image.css({
           'background': 'url("' + thumb + '") no-repeat center',
            //Background case
            // changed background-size from initial to 50% 50% !important
           'background-size': '50% 50% !important'
     });
    $image.show();
}

Can anyone help me how can I do that?

Any help would be appreciated.

Thanks In advance..!


texts: how to get the custom page event happened data to observer in magento 2?

texts:
I have custom module observer in Magento 2

<event name="controller_action_postdispatch_mpquotesystem_sellerquote_quoteedit">
        <observer name="webkul_mpquote_sellerquote_managequote_after_observer2" instance="Webkul\Mpquotesystem\Observer\Sellerquoteupdateafter" />
    </event>

after the event happened I want the
details of the page - data

  controller_action_postdispatch_mpquotesystem_sellerquote_quoteedit

how I can do this

Like this --- if I create order observer - getting an order in the observer


texts: Changing the item renderer for a certain product in Admin area?

texts:
I placed this in the custom layout section of my product:

<reference name="checkout.cart">
    <action method="addItemRender">
        <type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default_test.phtml</template>
    </action>
</reference>

Thing is, it doesnt not do a thing. When I edit checkout.xml and put my template there, it works. What am I doing wrong? I want to change the renderer in the admin area.

Thanks!


texts:
I tried to update some Amasty modules today and have been struggling a lot. and now I'm stuck.
When I run
I get this error: PHP Fatal error:  Uncaught Error: Undefined class constant 'Amasty\Blog\Model\ResourceModel\Categories::STORE_TABLE_NAME' in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116 Stack trace: #0 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Amasty\\Blog\\Set...', Array) #1 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Amasty\\Blog\\Set...', Array) #2 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/Setup/Patch/PatchApplier.php(149): Magento\Framework\ObjectManager\ObjectManager->create('\\Amasty\\Blog\\Se...', Array) #3 /chroot/home/a96f0e0b/stores.etailhandel.no/html/setup/src/Magento/Setup/Model/Installer.php(1006): Magento\Framework\Setup\Patch\PatchApplier->a in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116 {"messages":{"error":[{"code":500,"message":"Server internal error. See details in report api\/1232703043988"}]}}[a96f0e0b@etailhandel ~/stores.etailhandel.no/html]$ ^C
Anyone that knows what this can be? I rolled back to the old version and still gets this error.


texts:
I want my top links in the order like:

My Account
My Wishlist
My Orders
Sign In

But I am getting like:

My Account
My Wishlist
Sign In
My Orders

Below is my code:

<referenceBlock name="top.links">
        <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link" before="my-account-link"
               template="Magento_Customer::account/link/authorization.phtml"/>

        <block class="Magento\Customer\Block\Account\Link" name="my-account-link" after="authorization-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">My Account</argument>
                <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link-top" after="my-account-link" before="-">
            <arguments>
                <argument name="path" xsi:type="string">sales/order/history</argument>
                <argument name="label" xsi:type="string" translate="true">My Orders</argument>
            </arguments>
        </block>

        <block class="Magento\Customer\Block\Account\RegisterLink" name="register-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">Create an Account</argument>
            </arguments>
        </block>

    </referenceBlock>


texts:
I have entered the product price excluding VAT in the backend.

In the TAX configuration, setting is

Display Product Prices In Catalog set as Including Tax.

In the product page, product price and special price is getting displayed with including 20%VAT.

But the featured products in the home page displaying the price with excluding VAT. I have used the code for featured products,

echo Mage::helper('tax')->getPrice($_product, $_product->getPrice(), true);
echo Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice(), true);

Both returning the price excluding the VAT. Products in the home page needs to return price including VAT.  Could anyone help on this?


texts: Update prices catalog_product_attribute_update_before instead of catalog_product_save_before

texts:
I wrote module that is updating prices when I click save product. It's using catalog_product_save_before and its loading extra attributes like:

    $price1 = $product->getprice_extra1();
    $price2 = $product->getprice_extra2();
    $price3 = $product->getprice_extra3();

and its work perfectly, however to calculate all prices I need to manually open product and save.

I was trying to use prices catalog_product_attribute_update_before event and save using selection of products and change attributes in product list but its throwing php error:

  PHP Fatal error:  Uncaught Error:
  Call to a member function getprice_extra1() on null in ...

Same error when I try to use events: update after import and cron.

I think when I'm using this different events I need to  load something else.

Or maybe some of attributes are without value and this is causing error.

UPDATE:

It looks like on update attributes all products data is not loaded I need add something with @var \Magento\Framework\Registry


texts:
I currently have a email pop up modal in my magento CMS but I need to hide the api so my script I will keep server side in PHP.
My question is how can I have a phtml that is just a script be imported into magento if that is possible.
this is my script
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.sendgrid.com/v3/marketing/contacts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{"list_ids": [
  "fsfsfsfsfsf"
 ],
 "contacts": [
   {
     "email": "jgjgjghj@gmail.com",
     "first_name": "jffff gih"
   }
 ]
}',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer jhdfjhhueurheufheo',
    'Content-Type: application/json'
  ),
));

I omitted the api key and list id key for example reasons.


texts: Magento 2.2.5: When deploying not coping css to pub/static

texts:
I have a Magento 2.2.5 based website and when I do a below command:

php bin/magento setup:di:compile
and then
php bin/magento setup:static-content:deploy

And then I look in the

pub/static/frontend/Smartwave/porto_child/en_US/css

And the same CSS file that is in

app/design/frontend/Smartwave/porto_child/web/css

Is not copied over to the pub static folder?
I checked and the Magento mode is production. Also I made sure the pub static is writable. I also tried renaming the static folder to 'static---' and then recompiled and redeployed and again the CSS file for some reason was not there in pub static?


texts: Magento 2 : How to pass custom data in existing event

texts:
I am trying to pass
$pagedata  = new \Magento\Framework\DataObject(array('name' => 'customdata'));
        $this->eventManager->dispatch('customer_login', ['customer' => $customerDataObject, 'obj' => $pagedata]);

In observer
$displayname = $observer->getData('obj');
        echo $displayname->getName(); exit;

But i am not getting data and getting getData on null error
Any thoughts ?
Update - i have override that class in my module & added another data object in dispatch & tried to get it


texts: Use two database connection in local.xml

texts:
I have a question about database connection in Magento
I would like to use a primary database to read and write data and if this database will have a problem and goes offline, I would like to use another database to read and write data.
Is possibile to configure two database in local.xml?


texts: How to execute javascript function after a product is added to cart?

texts:
I'm trying to configure Sendinblue Automation to work with Magento 2. In order to do that, I have to execute some Javascript functions after some Magento events like:

After a product is added to cart.
After the cart is updated.
After the cart is empty.
After a product is bought.

How can I do that?


texts:
I have heard by some developers that while making changes to magento2 backend (like adding a extension), one should disable varnish (so that changes we make get visible on the frontend).

Is that true?

If it is, then, in what scenarios, one should disable varnish, and, under what scenarios, we need not disable varnish?


texts:
I am using Magento 1.9.2.

I have custom product attribute for every product in my store. The attribute code is product_link.

I have this code to get all products in the current cart session:

<?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
$app = Mage::app('default');
Mage::app();

Mage::getSingleton('core/session', array('name' => 'frontend'));

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    $ProductLink = $item->getProduct()->getProductLink();
    $ProductName = $item->getProduct()->getName();
    echo "ProductLink: $ProductLink - ProductName: $ProductName<br>";
}

I have no problem to get the name of the product which is a default attribute.
However i can not get the link value in product_link attribute which all products have.

Where is my mistake how may i fix it?


texts: adding save button with ui_component not working

texts:
after adding the button in ui_component. i give  error  500 Internal Server Error not going to post values on save controller. It posting on current url. Example i am using for adding the button.

Question reference

<argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">categories_index_edit.category_form_data_source</item>
            <item name="deps" xsi:type="string">categories_index_edit.category_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">News Category</item>
         <!-- <item name="config" xsi:type="array">
            <item name="dataScope" xsi:type="string">data</item>
            <item name="namespace" xsi:type="string">categories_index_edit</item>
        </item> -->
        <item name="template" xsi:type="string">templates/form/collapsible</item>
        <item name="buttons" xsi:type="array">
            <item name="back" xsi:type="string">Namespace\Modulename\Block\Adminhtml\Category\Edit\BackButton</item>
            <item name="save" xsi:type="string">Namespace\Modulename\Block\Adminhtml\Category\Edit\SaveButton</item>
           </item>
        <item name="layout" xsi:type="array">
            <item name="type" xsi:type="string">tabs</item>
        </item>

    </argument>

error

  Notice: Undefined index: data in
  /opt/lampp/htdocs/m2_module/vendor/magento/framework/View/Element/UiComponent
  /ContentType/Json.php on line 71

  0 /opt/lampp/htdocs/m2_module/vendor/magento/framework/View/Element/UiComponent/ContentType/Json.php

  (71): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined
  index...', '/opt/lampp/htdo...', 71,  Array)

  1 /opt/lampp/htdocs/m2_module/vendor/magento/module-ui/Component/AbstractComponent.php(118): Magento
  \Framework\View\Element\UiComponent\ContentType\Json->render(Object(Magento\Ui\Component\Form),
  'templates /form/...')

  2 /opt/lampp/htdocs/m2_module/vendor/magento/module-ui/Component/Wrapper/UiComponent.php(72):
  Magento \Ui\Component\AbstractComponent->render()


texts: Is Magento planning on implementing Zend Framework 2?

texts:
Is Magento considering updating to ZF2? I understand ZF2 has been around for a few years. Why isn't it already using it?

Re: Zend Framework Versions


texts: How to sort the product collection on an attribute?

texts:
I am doing the following to sort the product collection based on an attribute whose values are actually of type "String" but can only hold 0 or 1. I also mentioned default value as 0.

$collection = $this->getCollection()
    ->addAttributeToSort('attr_name' *1, 'DESC');

In the above code, since the attribute type is "string", I added *1 to convert the string type to Integer as mentioned in this post.

What should I do to sort the product collection based on a attribute which is of type string but has only values 0 and 1?

PS: The collection is being sorted with other attribute in __construct function already and then made to setCollection($collection).


texts: How to change the order status cancel in magento after payment cancelled from MIGS Payment Gateway?

texts:
I integrate my website with MIGS payment Gateway.

I have an issue on orders, if customer cancel the payment from payment gateway successfully return to website and show the order as cancelled but from the admin panel order status shows as processing.

How can i update order status as cancelled.

I tried this  by magento event observer. But It is not working.
Following are my coding.

File Wired_Orderscancel.xml(Path:-/app/etc/modules)

<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Wired_Orderscancel>
        <active>true</active>
        <codePool>local</codePool>
    </Wired_Orderscancel>
</modules>

File config.xml(Path:-\app\code\local\Wired\Orderscancel\etc)

<?xml version="1.0"?>
<config>
<modules>
    <Wired_Orderscancel>
        <version>0.1.0</version>
    </Wired_Orderscancel>
</modules>
<global>
    <models>
        <orders>
            <class>Wired_Orders_Model</class>
        </orders>
    </models>
    <helpers>
        <orders>
            <class>Wired_Orders_Helper</class>
        </orders>
    </helpers>
    <events>
        <sales_order_payment_cancel>
            <observers>
                <change_order_status>
                    <class>orders/observer</class>
                    <method>CodeOrdeStatus</method>
                </change_order_status>
            </observers>
        </sales_order_payment_cancel>
    </events>
 </global>
</config>

File Observer.php (Path:-\app\code\local\Wired\Orderscancel\Model)

class Wired_Orders_Model_Observer extends Varien_Event_Observer
{
public function CodeOrdeStatus($observer){

    $order = $observer->getEvent()->getOrder();
    $order=Mage::getModel('sales/order')->load($order->getId());

    //$order->setData('state', "complete");
    $order->setStatus("canceled");
    $order->save();

}
}

How can i fix this issue,
Thank you


texts: Added product via REST API OAuth not retrieved and not able to update via REST API

texts:
After adding product to Magento run http://mymagentohost/api/rest/products/40 it will return Resource not found but if just open product from Magento and click on save (without changing anything) than (run http://mymagentohost/api/rest/products/40) it will return product in xml view.

some code for saving product using REST OAuth as below

$this->productData = array(
            'type_id' => 'activities',
            'attribute_set_id' => 4,
            'sku' => 'activities' . uniqid(),
            'status' => 1,
            'visibility' => 4,
            'name' => 'Activities Product',
            'description' => 'Activities Description',
            'price' => 10.00,
            'sm_product_vendor_id' => 23,
            'category_id' => 1,
            'tax_class_id' => 0,
........);

function saveProduct(){

try {
    $oauthClient = new OAuth($this->consumerKey, $this->consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $this->authType);
    $oauthClient->enableDebug();
    $oauthClient->setToken($this->token, $this->secret);

    $headers =  array('Content-Type' => 'application/json');

    $oauthClient->fetch($this->resourceUrl, $this->productData, "POST", $headers);

    $this->responceInfo = $oauthClient->getLastResponseInfo();

    $this->responce = $oauthClient->getLastResponse();

} catch (OAuthException $e) {
        $this->oauthError=$e;
}
}

$this->saveProduct();

Response Info

....
    [headers_recv] => HTTP/1.1 200 OK
    Date: Wed, 14 Aug 2013 03:15:59 GMT
    Server: Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/0.9.8o
    X-Powered-By: PHP/5.3.14 ZendServer
    Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
    Set-Cookie: PHPSESSID=rrom4add03f0ikrt6d51ej9gi5; expires=Wed, 14-Aug-2013 04:16:00 GMT; path=/magento; domain=localhost; HttpOnly
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    /api/rest/products/40
.....

when i try to run http://mymagentohost/api/rest/products/40

it will return Resource not found

<magento_api><messages><error><data_item>404<message>Resource not found.</message></data_item></error></messages></magento_api>

Edit
while adding product via REST API following data not inserted in table (2 tables) .
if i manually add following data in table than it will be retrieved via REST API.
how to add this records using REST API

magento_catalog_product_index_price

magento_catalog_product_website


texts: Magento keeps invoking install script after deployment

texts:
I'm trying to move my Magento store from local to web server. But I run into a problem:

The install wizzard pops out, I can't figure out why.

What I tryed till now:

Double checked the database settings - OK.
Mage.php exists in app folder.
Deleted files from /var folder - left only the folder's.
UPDATE: Changed permisions to 777 - Problem remains...

Thank you guys.

here is the content of local.xml, maybe there is a problem? I've changed the Host, user, pass and db.

<config>
<global>
    <install>
        <date><![CDATA[Wed, 08 May 2013 17:08:50 +0000]]></date>
    </install>
    <crypt>
        <key><![CDATA[e90bf233553fe3516b20edc85438eb3d]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
        <db>
            <table_prefix><![CDATA[]]></table_prefix>
        </db>
        <default_setup>
            <connection>
                <host><![CDATA[127.0.0.1]]></host>
                <username><![CDATA[root]]></username>
                <password><![CDATA[]]></password>
                <dbname><![CDATA[todoiphonestore]></dbname>
                <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                <model><![CDATA[mysql4]]></model>
                <type><![CDATA[pdo_mysql]]></type>
                <pdoType><![CDATA[]]></pdoType>
                <active>1</active>
            </connection>
        </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
</global>
<admin>
    <routers>
        <adminhtml>
            <args>
                <frontName><![CDATA[admin]]></frontName>
            </args>
        </adminhtml>
    </routers>
</admin>

Update and solution:
If you'll take a closer look to the local.xml I've pasted you'll see my mistake, I was mising one of the ] sign's in <dbname> so Magento couln't connect to the database... When I added this symbol, everything became normal. Well, few more minor issues, but the main problem was solved.


texts: Magento 2 - Configurable how to get Name of first associated product

texts:
I need to get the name and assigned attributes value of the first associated product of configurable in Magento 2.

I use something like this:

$_product->getResource()->getAttribute('color')->getFrontend()->getValue($_product);

but this return the value of the configurable product not the value of associated product.

Thank you


texts: Magento 2 create product attribute that sits outside of 'More information' tab

texts:
I'm trying to create a product attribute, but I don't want it to sit under the more info tab. I would like to almost be its own block and sit under the 'Add to cart' button.

How would I go about doing this?


texts:
I am working on Magento 2 extension and I am facing below error.

a:4:{i:0;s:79:"Two 'add' commands cannot have equal id (Vendor_Mymodule::mymodule)";
i:1;s:6358:"#0 /home/mcs/html/demo/m2/Module/vendor/magento/module-backend/Model/Menu/Builder.php(43):
Magento\Backend\Model\Menu\Builder\Command\Add->chain(Object(Magento\Backend\Model\Menu\Builder\Command\Add))

below is menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>

        <add id="Vendor_Mymodule::mymodule_manager" title="mymodule" module="Vendor_Mymodule" parent="Vendor_General::general" sortOrder="10" resource="Vendor_Mymodule::mymodule_manager" />

        <add id="Vendor_Mymodule::mymodule" title="Manage Text" module="Vendor_Mymodule" sortOrder="11" parent="Vendor_Mymodule::mymodule_manager" action="mymodule/index" resource="Vendor_Mymodule::mymodule"/>

        <add id="Vendor_Mymodule::mymodule_data" title="Manage Data" module="Vendor_Mymodule" sortOrder="11" parent="Vendor_Mymodule::mymodule_manager" action="mymodule/index" resource="Vendor_Mymodule::mymodule"/>
    </menu>
</config>

Please help me resolve the issue.


texts:
Our Magento store running on 1.9.x is using Percona MySQL server 5.6.29 and since our site generates loads of MySQL queries, I need caching as much as possible. I have configured my.cnf like this

# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

explicit_defaults_for_timestamp = 1
skip-name-resolve
innodb_file_per_table
innodb_thread_concurrency = 26
query_cache_size = 512M
query_cache_limit = 18M
thread_cache_size = 64
key_buffer_size = 512M
max_allowed_packet = 64M
table_open_cache = 2000
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 64M
max_heap_table_size = 1024M
tmp_table_size = 1024M
query_cache_type = 1
wait_timeout = 300
max_connections = 200
innodb_buffer_pool_size = 64G
innodb_buffer_pool_instances=125
innodb_log_buffer_size=18M

# Disabling symbolic-links is recommended to prevent assorted security risks
# symbolic-links=0

# Recommended in standard MySQL setup
# sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

# Slow Query
slow_query_log=1
slow_query_log_file=/var/log/mysql_slow_queries.log

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Our database size is just 6GB and machine has 120GB of RAM, so I need caching as much as possible to make things quicker. So, does the above configuration fits for BEST caching or is there any value I need to tune or add into?


texts:
so I just set up my M1.9 store, and want to set up a REST API. I wanted to test it out by retrieving a list of products. I only don't know what to put in the callbackurl field, online they say the location of the .php file I'm using but I'm running it locally and the magento server is on a dedicated server, so that doesn't work out.

Here's the code i use

<?php
$callbackUrl = "";
$temporaryCredentialsRequestUrl = "http://52.59.36.230/magento/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://52.59.36.230/magento/admin/oauth_authorize';
$accessTokenRequestUrl = 'http://52.59.36.230/magento/oauth/token';
$apiUrl = 'http://52.59.36.230/magento/api/rest';
$consumerKey = '***';
$consumerSecret = '***';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
    $_SESSION['state'] = 0;
}
try {
    $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
    $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
    $oauthClient->enableDebug();

    if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
        $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
        $_SESSION['secret'] = $requestToken['oauth_token_secret'];
        $_SESSION['state'] = 1;
        header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
        exit;
    } else if ($_SESSION['state'] == 1) {
        $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
        $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
        $_SESSION['state'] = 2;
        $_SESSION['token'] = $accessToken['oauth_token'];
        $_SESSION['secret'] = $accessToken['oauth_token_secret'];
        header('Location: ' . $callbackUrl);
        exit;
    } else {
        $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);
        $resourceUrl = "$apiUrl/products";
        $oauthClient->fetch($resourceUrl);
        $productsList = json_decode($oauthClient->getLastResponse());
        print_r($productsList);
    }
} catch (OAuthException $ex ) {
    print_r($e);
}
?>

Anyone who could help me further ?

EDIT:

I'm running my code trough PHPStorm, so it uses my localhost. The magento server is running on an AWS instance.


texts: Magento 2.2.2 cart price rule 3 for $ 1 of each category

texts:
Is there a rule so I can trigger when 3 items are in cart but it needs to be 1 of each category!
E.G: (1x Women) + (1x Men) + (1x kid) then trigger fixed price for all of them 3 e.g: $15
it cannot be (3x women) or (3x Men) or  (3x kid) for $15 this should not trigger.
It must trigger only if there is 1 item from each category in cart.
Any suggestion if magento can handle or if not any module available for this all?
Thanks


texts: Getting products in a category not under the current store's root

texts:
I would like to loop through a set of categories which are under a separate root, in order to generate a simple list of products. I put them under a separate root category because otherwise they end up appearing in odd places in the shop (they would be catalog visible)

This has been a nightmare as all the normal objects and collections seem to have a test that is about the site's own root (or something). At first I thought it was because of flat tables but it wasn't. It is the product collection's code.

I managed to find the category IDs via the tree:

$categoryid = 14;
$nodes = Mage::getResourceModel('catalog/category_tree')->loadNode($categoryid)->loadChildren(1)->getChildren();

But to get products none of the normal ways work

$categoryid = 14;
$category = Mage::getModel('catalog/category')->load($categoryid);
$collection1 = $category->getProductCollection();
$collection2 = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);

NO RESULTS in either results when the category id is outside the main tree. (both work fine for a category inside the tree). I think each time we end up in product_collection's addCategoryFilter which applies all sorts of limitations and has, as far as i can tell, no parameter to help bypass.

So far I have found the solution in Array of product ids for a given category (ignoring is_anchor) at least gives me the IDs

$categoryid = 14;
$category = Mage::getModel('catalog/category')->load($categoryid);
$positions = Mage::getResourceModel('catalog/category')->getProductsPosition($category);
$includeIDs = array_keys($positions);

but this feels very diagonal which makes me nervous. but it gets me a way to fetch products!

Is there a better way? A way that uses the category and product collections "properly" but bypasses the limitations of addCategoryFilter?


texts:
I'm still getting the error on my admin page "One or more indexers are invalid. Make sure your Magento cron job is running"
All field indexes rebuild successfully apart from Catalog Search.
I'm using Magento 2.3.0 with WAMP. Additionally the cache:flush command works?

$ php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:08
Customer Grid index has been rebuilt successfully in 00:00:11
Category Products index has been rebuilt successfully in 00:00:01
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:06
Product EAV index has been rebuilt successfully in 00:00:03
Stock index has been rebuilt successfully in 00:00:02
Inventory index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:04
Catalog Search indexer process unknown error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>405 Method Not Allowed</title>

Method Not Allowed

The requested method PUT is not allowed for the URL /magento2_product_1_v1.

<address>Apache/2.4.35 (Win64) PHP/7.2.10 Server at 127.0.0.1 Port 80</address>


texts: Magento1 Admin Order create shipping method missing

texts:
Magento 1, while creating an order from the admin shipping method is disappear I don’t know how. Before few days it was there. Under shipping method “Get shipping methods and rates” link was there but now it’s missing.

We have checked our demo environment its showing there. Shipping setting correct on both the website. But no shipping method on Live website.

Anyone please let me know what’s the issue?

  Live Screenshot:

  Staging Screenshot:


texts:
Magento search returns zero, while I print the query and execute in PHPMYADMIN - enough products are list.

Cache cleared
Re-indexed multiple times
no solution, need help

Below is my query:

SELECT e.*, price_index.price, price_index.tax_class_id, price_index.final_price, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS minimal_price, price_index.min_price, price_index.max_price, price_index.tier_price, cat_index.position AS cat_index_position FROM mg_catalog_product_entity AS e INNER JOIN mg_catalog_product_index_price AS price_index ON price_index.entity_id = e.entity_id AND price_index.website_id = '2' AND price_index.customer_group_id = 0 INNER JOIN mg_catalog_category_product_index AS cat_index ON cat_index.product_id=e.entity_id AND cat_index.store_id='2' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2'

Thanks


texts: show all products in one page on magento 2

texts:
I want to show all products in one page from a custom cms block.
This is the code I tried:
{{block class="\Magento\Catalog\Block\Product\ListProduct" template="Magento_Catalog::list.phtml"}}

It doesn't work because the page is blank.


texts:
We have rental products that are constantly going out to customers and coming back to us. However, remembering what customers have which products is a pain.

Is there any way to search by a product / order to see what customer currently possesses a product? Or better yet, to see the historical records of this product?


texts:
The table 'media_storage_file_storage' is very big.
Can I truncate this table if I use "File System" as "Media Storage"?


texts: Where does phtml-file get its data in magento2?

texts:
In the file app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml

On line 46 there is variable "data" being called:


texts: Add Shipping country in Sales Order report Magento2

texts:
I am trying to add Shipping country as extra column and filter,
how that can be achieved. can anyone help me on this.

referred the below Url, but which was not helpful for me.
Magento 2: How to add custom filters in Orders Report?
How to add new field in the Sales order report with the shipping country drop down list filter.
Vendor/Module/etc/adminhtml/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Sales\Block\Adminhtml\Report\Filter\Form\Order" type="Vendor\Module\Block\Adminhtml\Report\Filter\Form\Order" />
   <preference for="Magento\Reports\Block\Adminhtml\Sales\Sales\Grid" type="Vendor\Module\Block\Adminhtml\Sales\Sales\Grid" />
</config>

Vendor\Module\Block/Adminhtml/Report/Filter/Form/Order.php
class Order extends \Magento\Sales\Block\Adminhtml\Report\Filter\Form\Order
{
 protected function _prepareForm()
 {
     parent::_prepareForm();
     $fieldset = $this->getForm()->getElement('base_fieldset');

    if (is_object($fieldset) && $fieldset instanceof \Magento\Framework\Data\Form\Element\Fieldset) {
        $fieldset->addField(
            'shipping_country',
            'select',
            [
                'name' => 'shipping_country',
                'options' => ['gbr' => __('United Kingdom'), 'in' => __('India')],
                'label' => __('Shipping Country')
            ]
        );
    }

    return $this;
 }
}

Vendor/Module/Block/Adminhtml/Sales/Sales/Grid.php
use Magento\Framework\DataObject;
use Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency;
use Magento\Framework\App\ObjectManager;
use Magento\Sales\Model\Order\ConfigFactory;
use Magento\Sales\Model\Order;

class Grid extends \Magento\Reports\Block\Adminhtml\Sales\Sales\Grid
{
  protected $_columnGroupBy = 'period';

  private $configFactory;

   public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Backend\Helper\Data $backendHelper,
    \Magento\Reports\Model\ResourceModel\Report\Collection\Factory $resourceFactory,
    \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory,
    \Magento\Reports\Helper\Data $reportsData,
    array $data = [],
    ConfigFactory $configFactory = null
) {
    parent::__construct(
        $context,
        $backendHelper,
        $resourceFactory,
        $collectionFactory,
        $reportsData,
        $data
    );
    $this->configFactory = $configFactory ?: ObjectManager::getInstance()->get(ConfigFactory::class);
}

protected function _prepareColumns()
{
    $this->addColumn(
        'shipping_country',
        [
            'header' => __('Shipping Country'),
            'index' => 'shipping_country',
            'type' => 'number',
            'sortable' => false,
            'header_css_class' => 'col-sales-items',
            'column_css_class' => 'col-sales-items'
        ]
    );

    return parent::_prepareColumns();
   }
}

I have used the above code, a column shown in the grid with the filter.
How to get shipping country in report? I am getting empty values for the column.
please someone update me how this can be achieved?
Thanks in Advance!!


texts: How to create a productrepository using object manager in Magento 2?

texts:
I want to save/update the product in phtml file and I need to create productRepository using object manager.
I don't want any controller to be called. Is there any possibility to save product in phtml file without calling controller or helper class?


texts: Magento 2.3.1 - Issue with script Google Tag Manager (GTM) in

texts:
I am trying to implement GTM in magento 2.3.1. But i could not able to make it successful.

I have used the extension WeltPixel Extension to configure GTM to my site and manually method too but when it inject the code in the <head> it's show a bank code, just show the comment but no <script>

Google tag Assistant:

php Version 7.2


texts:
I'm getting this message sporadically all of a sudden and I'm not sure how to fix it.

    [2017-04-07 20:09:32] main.CRITICAL: PDOException: SQLSTATE[HY000] [2002]
Connection refused in /httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128

Here is my mysql configuration in magento

array (
        'host' => 'localhost',
        'dbname' => 'database',
        'username' => 'username',
        'password' => 'password',
        'active' => '1',
      ),


texts: Magento 1 to 2 migration error, Categories failed

texts:
Using UB-Migration tool, Migrating from Magento 1 to Magento 2.
All steps were successful apart from Step 4 Categories which failed with below error, please assist.
Error received
Research: I had googled and found that its caused by the source DB(magento 1) not the M2.
I checked table: catalog_category_entity
select * from catalog_category_entity WHERE parent_id is NOT null;
returned: 0 rows effected.
2020/12/10 09:42:15 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent_id' cannot be null. The SQL statement executed was: UPDATE `catalog_category_entity` SET `entity_id`=:yp0, `attribute_set_id`=:yp1, `parent_id`=:yp2, `created_at`=:yp3, `updated_at`=:yp4, `path`=:yp5, `position`=:yp6, `level`=:yp7, `children_count`=:yp8 WHERE `catalog_category_entity`.`entity_id`='1193'


texts: How are customers coming through as "Guest"?

texts:
Once a week we will have customers purchase through our site, but the account information comes through as:

Customer name: Guest
Email: ______ (blank)
Customer Group: Taxable

Any thoughts on how this is happening? Email and Name are required fields for guests or account users.


texts: Magento 2- secured website but still DNS error

texts:
i secured my website in the starting so that i can't get any error but its giving me an error:

everyday.
even if any new client visit my web it shows the error and then you have to clear the history but after 20-30 minutes it shows the error again.
i'm fed up of this can someone here tell me the permanent solution for this?


texts: How to store value in custom option field programmatically from cart page?

texts:
I've created custom option to store text for products programatically using after save observer as below:

  /var/www/html/mylocal/app/code/Custom/Addcustomoption/Observer/Catalog/ProductSaveAfter.php

<?php
namespace Custom\Addcustomoption\Observer\Catalog;

use Magento\Catalog\Model\Product\Option;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Catalog\Model\ProductRepository;
use Magento\Catalog\Api\Data\ProductCustomOptionInterface;
use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory as CustomOptionFactory;

class AddCustomOptions implements ObserverInterface
{
    /**
     * @var ProductRepository
     */
    protected $productRepository;

    /**
     * @var CustomOptionFactory
     */
    protected $customOptionFactory;

    /**
     * @var ProductCustomOptionInterface
     */
    protected $productCustomOption;

    /**
     * AddCustomOptions constructor.
     *
     * @param ProductRepository            $productRepository
     * @param ProductCustomOptionInterface $productCustomOption
     */
    public function __construct(
        ProductRepository $productRepository,
        ProductCustomOptionInterface $productCustomOption
    ) {
        $this->productRepository = $productRepository;
        $this->productCustomOption = $productCustomOption;
    }

    /**
     * {@inheritdoc}
     */
    public function execute(Observer $observer)
    {
        /** @var \Magento\Catalog\Model\Product $product */
        $product = $observer->getData('product');

        try{
            $pop = $product->getPop();
            if( !$product->getHasOptions() /*&& $pop != NULL*/){

                $customOptionData = [
                    Option::KEY_TITLE => 'Customer Profile',
                    Option::KEY_TYPE => 'field',
                    Option::KEY_IS_REQUIRE => true,
                    Option::KEY_SORT_ORDER => 1,
                    Option::KEY_PRICE => 0.00,
                    Option::KEY_PRICE_TYPE => 'fixed',
                    Option::KEY_MAX_CHARACTERS => 100,
                    Option::KEY_PRODUCT_SKU => $product->getSku()

                ];
                $customOption = $this->getCustomOptionFactory()->create(['data' => $customOptionData]);
                $customOptions[] = $customOption;
                $product->setOptions($customOptions)->setCanSaveCustomOptions(true)->save();
                }
            } catch (\Exception $e) {
                var_dump($e->getMessage());
            }
    }
    /**
     * @return CustomOptionFactory
     */
    private function getCustomOptionFactory()
    {
        if (null === $this->customOptionFactory) {
            $this->customOptionFactory = \Magento\Framework\App\ObjectManager::getInstance()
                ->get('Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory');
        }
        return $this->customOptionFactory;
    }
}

In default the custom option input field is present in product detail page. I do not want to use this input field so that I've hidden it.

In cart page for each product I take input from a dropdown for each product which comes dynamically based on logged in user. I need to save that value selected by user to the custom option field programmatically.

How can I do this?


texts: Magento - Please specify the product required option(s) Error

texts:
I got a problem using Magento about add to cart with custom options.

I filled up all required fields and when I hit "Add To Cart" button, It said

  Please specify the product required option(s).

When I go to other products without custom options like Size or Color field. It works fine.

How can I fix this problem?

this is the link: https://francesandalbert.com/ring.html

Thanks.


texts: Where does Magento store qty returned to stock for credit memos?

texts:
When creating a credit memo in Magento one has the option to return stock managed products to stock.

How can one tell - by looking at an existing credit memo - whether or not the admin decided to return any units to stock?

I've looked at the backend & the table structure and this information is seemingly not visible anywhere.

Any ideas?


texts: Unable to Edit Products - php-fpm hanging

texts:
Enterprise v1.14.0.1
Nginx / php-fpm / Memcached

Any attempt to save a product in the admin panel results in:

the ajax check comes back fine {"error":false}
the request with all of the form data hangs, causes a php-fpm process to sit there and hang until timed out: 502 Bad Gateway
there is not a corresponding mysql query that is hanging... it's as if the data is waiting to be transmitted to the db
exception log, system log show nothing
php-fpm log simply shows the disconnect

[01-Jul-2014 11:51:24] WARNING: [pool www] child 10981 exited on signal 9 (SIGKILL) after 88731.019348 seconds from start

[01-Jul-2014 11:51:24] NOTICE: [pool www] child 2599 started

Since turning on php-fpm debug logs and trying again, I get a bit more information:

[01-Jul-2014 12:29:36.906782] WARNING: pid 3144, fpm_request_check_timed_out(), line 281: [pool www] child 3410, script '/var/www/magento/index.php' (request: "POST /index.php") execution timed out (210.640298 sec), terminating
[01-Jul-2014 12:29:36.919687] DEBUG: pid 3144, fpm_got_signal(), line 76: received SIGCHLD
[01-Jul-2014 12:29:36.919842] WARNING: pid 3144, fpm_children_bury(), line 252: [pool www] child 3410 exited on signal 15 (SIGTERM) after 300.042214 seconds from start
[01-Jul-2014 12:29:36.921385] NOTICE: pid 3144, fpm_children_make(), line 421: [pool www] child 3527 started
[01-Jul-2014 12:29:36.921443] DEBUG: pid 3144, fpm_event_loop(), line 419: event module triggered 1 events

[EDIT: Correction to previous edit] We are NOT receiving any PHP errors.  I've confirmed the PHP error log is working.  (I previously reported we were receiving PHP errors... but it turns out these were from more than a week ago - and are unrelated)

Further investigation:

Although we are receiving an 502 Bad Gateway error (after the page hangs for several minutes), the product is saving the edited information.  It appears that the response is not coming back to the browser after the DB update query has finished.

I've confirmed that the controller is hanging at $product->save(); in the file:
magento/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php

/**
 * Save product action
 */
public function saveAction()
{
    $storeId        = $this->getRequest()->getParam('store');
    $redirectBack   = $this->getRequest()->getParam('back', false);
    $productId      = $this->getRequest()->getParam('id');
    $isEdit         = (int)($this->getRequest()->getParam('id') != null);
   $data = $this->getRequest()->getPost();
    if ($data) {
        $this->_filterStockData($data['product']['stock_data']);
        $product = $this->_initProductSave();
        try {
            Mage::log(__LINE__.' - commencing to save product');
            $product->save();
            Mage::log(__LINE__.' - completed saving');

What else can I look at to troubleshoot this?  Thanks for any suggestions.


texts: error Requested product doesn't exist in magento2

texts:
when I am displaying product name through product id Requested product, doesn't exist an error is coming

<?php
    namespace Magneto\PopupQuestion\Ui\Component\Listing\Column;
    use \Magento\Catalog\Api\ProductRepositoryInterface;
    use \Magento\Framework\View\Element\UiComponent\ContextInterface;
    use \Magento\Framework\View\Element\UiComponentFactory;
    use \Magento\Ui\Component\Listing\Columns\Column;
    class Products extends Column
    {
        protected $_ProductRepository;
        public function __construct(
            ContextInterface $context,
            UiComponentFactory $uiComponentFactory,
            ProductRepositoryInterface $ProductRepository,
            array $components = [],
            array $data = []){
            $this->_ProductRepository = $ProductRepository;
            parent::__construct($context, $uiComponentFactory, $components, $data);
        }
        public function prepareDataSource(array $dataSource){
            if (isset($dataSource['data']['items'])) {
                foreach ($dataSource['data']['items'] as &$items) {
                $productArr = [];
                $product  = $this->_ProductRepository->get($items["entity_id"]);
                foreach ($product->getAllVisibleItems() as $item) {
                $productArr[] = $item->getName(); //to get product name
            }
                $items['products'] = implode(' - ', $productArr);
                unset($productArr);
            }
        }
        return $dataSource;
    }
}


texts: How to add new link on checkout page in Magento 2.2.4?

texts:
I have created 1 custom tab on the checkout page and it's working fine I follow below link to add the tab on cart page.

Magento 2 - Add step on checkout

I want to add a link name as "Create an account".On click of that link, I want to redirect the page on create account page.


texts: How can I use the additional functions of AvS_FastSimpleImport in the backend?

texts:
The AvS_FastSimpleImport provides some handy functionality (for example auto-creating drop-down attributes). But it is aimed on constructing your own array.

There are use cases where shop owns should be able to insert data using the upload function in the backend.

It is possible to seamlessly integrate this functionality into the backend?

I guess we basically just have to exchange the import adapter somewhere?


texts:
I am facing some issue with product url when i duplicate product. In detail,

Existing Product: Existing_product
Duplicate Product : Duplicate_product

After duplicating(clicking on "Duplicate" of Existing_product) the product , i changed Name,Sku and other attributes(except URL) and saved the product.

Now the url key of Duplicate_product is showing correctly in the backend but it is different on frontend.

Existing Product's URL: www.website.com/store/existing_product.htm
Duplicated Product's URL: www.website.com/store/existing_product_1.htm
(which should be www.website.com/store/duplicate_product.htm)

Moreover www.website.com/store/existing_product_1.htm redirects to correct product that is duplicated product.

If it is not clear ,let me know.

Can anyone help in this issue?

Thanks


texts: Magento 2: can't ship order in the backend

texts:
I've just migrated my Magento 1.9 data to Magento 2.3.1.

Everything works well, but in certain circonstances, I can't ship the order in the back end.

Let's take an example.

I place an order for a product that has stock = 0 but where backorder is configured as "Allow quantity below 0".

So the order is placed without any problem.

Now when trying to ship this order, I have the following message:

Source item not found by source code: default and sku: Jupon-Vivianna-H2-220cm-Ivoire-50 (4XL).

Here how this product looks like:

First guess was salable quantity is blank, so I went on Stores > Configuration > Inventory

And to put a Negative amount in the Out-of-Stock Threshold area (as suggested here (https://docs.magento.com/m2/ce/user_guide/catalog/inventory-backorders.html)

Now here how the product looks like now:

But when trying to ship the order after this configuration is done, I have now another error message:

Not all of your products are available in the requested quantity.

Already spent few days searching, modifying the configuration.... but still I'm not able to ship the order.

Note that when a configurable product has stock in real, I can ship.
It is only when stock is 0 with backorder on that I can't ship the order.

Any help would be great.

Thanks

PS: I was before testing that on Magento 2.3.0, and had the same issue.


texts: M2: Alternative way to display variations on product page

texts:
I'm managing a bicycle parts store on Magento 2. It has a couple of thousand configurable products with simple products attached to it. I'm displaying the configurable product's variations using Visual Swatches containing the variation's image.
While browsing the web, I came across a Dutch interior store that is using Magento 2 as well. However, they're using an alternative way of displaying variations on the configurable product. No dropdowns, no swatches. Instead, it's a list with all variations and separate cart buttons.

Is anybody familiar with this way of displaying? Is it a hidden Magento feature? A known module? I'm really interested, because it's much more efficient for my products.
Edit: site of sample image is: https://www.misterdesign.nl/collect-socket-low-hanglamp-ferm-living.html


texts:
I am trying to add an image zoom to our Magento EE 1.14.2.1 which apparently was removed by a prior developer. So I found a script called "jqzoom" http://www.myjqueryplugins.com/jquery-plugin/jqzoom which I want to use. I of course have added a call to Jquery in the head.phtml file and also added the call to the needed jqzoom js and css files in the media.phtml file. However now when I view a product detail page I see in the console the below error.

Uncaught TypeError: $(...).jqzoom is not a function

Now on the top of my media.phtml page I have

<!-- Load image zoom code -->
 <script type="text/javascript" src="<?php echo Mage::getUrl()?>skin/frontend/bronson/default/js/jquery.jqzoom-core.js"></script>

 <link rel="stylesheet" type="text/css" href="<?php echo Mage::getUrl()?>skin/frontend/bronson/default/css/jquery.jqzoom.css">
 <script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function($)
        {
           /* simple call */
            $('.cloud-zoom').jqzoom();

            /* more complex call*/
            /*var options = {
              zoomType: 'standard',
              lens:true,
              preloadImages: true,
              alwaysOn:false,
              zoomWidth: 300,
              zoomHeight: 250,
              xOffset:90,
              yOffset:30,
              position:'left'
              //...MORE OPTIONS
           };

           $('.cloud-zoom').jqzoom(options); */

        });

  </script>

At the top of the jquery.jqzoom-core.js file I have

     jQuery.noConflict();
     (function ($) {

So I am not sure why the site still does not see jqzoom as a function and how to fix?

                        *********

I updated my media.phtml to the below and no my issue is I do not see any errors in the console but but the image zoom also does not work.

jQuery.noConflict();

then I changed the /* simple call */ to

jQuery('cloud-zoom').jqzoom();


texts: Magento 2.2: How can I hide or disable Purchase Order payment method for front-end only?

texts: I am looking to remove Purchase Order payment method from front-end payment options, it should be available for Admin only. Is there an easy way to accomplish this?


texts:
I created a module that uses the "before_body_end". On some pages a second module also uses before_body_end. Is there a way to dermine the order ?

example:

to :


texts: How to mark a product as New in magento?

texts: Is there a way to make a product have a little label next to it saying 'New'. I noticed there is an option in the general settings of a product to set the dates for which it is new so how would I go about having a little label next to it saying "new"?


texts: How To Implement JavaScript Snippet in Magento .PHTML file so that it works?

texts:
I want to insert a JavaScript snippet in a Magento .phtml template file. Please, refer to the following question to review the JS snippet - it is the snippet of the chosen best answer:

$(function() {
var menu = $('#fixedbtn');
function isInViewport($this) {
   var elementTop = $this.offset().top;
   var elementBottom = elementTop + $this.outerHeight();
   var viewportTop = $(window).scrollTop();
   var viewportBottom = viewportTop + $(window).height();
if(elementTop < viewportBottom ==true){
    menu.addClass('fixedPosition');
}else {
    menu.removeClass('fixedPosition');
 }
}
$(window).scroll(function() {
isInViewport($('#footer-1'))
});
});

Now, this code works perfectly in a standard HTML file on a non-server environment. However, when I tried to implement it in a Magento website, it just doesn't work. I tried including it in my app.js, then tried placing it on the page itself between script tags. I tried replacing the $ with jQuery, alas, nothing seems to work.

How can I implement this JavaScript code in Magento template file? Could you please guide me in how I need to format the code, so that it works in Magento (2.1.8)?

Follow up:

Alright, at this point I'm quite unsure why the above code will not work as inline script on Magento .phtml template file. I've used JavaScript in this Magento set-up before, both in app.js and also as inline script all working fine. Here, for example, I have the following JS code snippet in copyright.phtml working just fine:

<script type="text/javascript">
jQuery(function() {
    jQuery(window).scroll(function() {
    if(jQuery(this).scrollTop() > 800) {
        jQuery('#back-top').fadeIn();
        jQuery('#back-top').style.display = "block";
    } else {
        jQuery('#back-top').fadeOut();
        jQuery('#back-top').style.display = "none";
    }
});
   jQuery('#back-top').click(function() {
    jQuery('body,html').animate({scrollTop:0},500);
});
});
</script>

I also added the following script inline:

<script type="text/javascript">
require(['jquery','domReady!'], function($){
console.log('hello world');
})
</script>

And "hello world" comes out as output in console upon page reload = so no problem with caches or script parsing. I place the desired JavaScript code within

<script type="text/javascript">
require(['jquery','domReady!'], function($){
..desired code snippet here.....
})
</script>

Reload page, and... it does not work. Odd? Any idea why?


texts:
Zendesk has a default translation file located at app/locale/lang_code/Zendesk_Zendesk.csv

The translations work perfectly in the admin section but not in the frontend.

In the frontend I'm using the same code as they use in the default adminhtml code
example:

<?php echo Mage::helper('zendesk')->__('Open Ticket') ?>

In the file app/code/community/Zendesk/Zendesk/etc/config.xml

I copied the following code

<translate>
        <modules>
            <translations>
                <files>
                    <default>Zendesk_Zendesk.csv</default>
                </files>
            </translations>
        </modules>
    </translate>

from the adminhtml tag and pasted it inside the frontend tag. But even after reindexing and clearing the cache the translations do not show up. But many online tutorials mention this as being sufficient. What am I doing wrong to translate the zendesk module frontend as well? (Feels like this should be a default feature anyway.)


texts: Google Chrome opens a magento multistore page the wrong page

texts:
We have an magento multistore page. Everytime I open the normal url (https://mag.outdoorequipped.com/) with my Google Chrome, it opens already an subpage and not the main store.

In all other browsers it works fine.

Does anybody has any idea, what this could be?

Our set up for multistore is follow:

Website name: Main Website

Store Name:

Home -> this needs to open the first time with mag.outdoorequipped.com
Active -> url: mag.outdoorequipped.com/active
Outdoor -> url: mag.outdoorequipped.com/outdoor
Fashion -> url: mag.outdoorequipped.com/fashion
Work -> url: mag.outdoorequipped.com/work


texts:
does magento suppose to create separate cache for each visitor?
I configured varnish using magento guide, but each new visitor gets cacheble page only on seocond load.


texts: Magento 1.9.4.3 Logged in users cant create order but guests can

texts:
If a user on our site is logged in and they try to create an order the checkout page just refreshes when they click complete order and no order is created.

If a guest tries to order it works fine.

Is there any noticeable difference in the way the order is processed when a user is logged in?

This started to happen after we upgraded the site to 1.9.4.3 from 1.7

There seems to be 2 relevant errors in the system log:

> ERR (3): Notice: Undefined index: custom  in /home/storm/sites/quickplaysport-com/public/app/code/local/Magestore/Onestepcheckout/Model/Observer.php on line 212

and

ERR (3): User Error: Some transactions have not been committed or rolled back  in /home/storm/sites/quickplaysport-com/public/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4039

any suggestions?


texts:
Magento Search Not Working.
Search Result: Your search returns no results.

What I have already done.

Visibility of the Product is set to Catalog, Search
Product Attribute name, SKU, color is set to Yes in Quick Search and is Global.
Tried with all Like,FullText,Combine in System->Catalog->Catalog Search.
Cleared Cache and Reindexing done several times.
Every Category including the root category is set to Yes is_anchor
And Did most of the solution given on StackOverflow.

Currently Using Theme Zorka.

Result After I search for a Product or Sku

SQL Query -->

SELECT e.*, search_result.relevance, price_index.price, price_index.tax_class_id, price_index.final_price, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS minimal_price, price_index.min_price, price_index.max_price, price_index.tier_price, cat_index.position AS cat_index_position FROM catalog_product_entity AS e
 INNER JOIN catalogsearch_result AS search_result ON search_result.product_id=e.entity_id AND search_result.query_id='111'
 INNER JOIN catalog_product_index_price AS price_index ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN catalog_category_product_index AS cat_index ON cat_index.product_id=e.entity_id AND cat_index.store_id='19' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2'


texts: how to show Promo code or coupon code on Checkout page in magento 1.9

texts: How can i show Promo code or coupon code on Checkout page in magento 1.9. And we can have option in admin panel or we do by code? please help me!!!


texts:
How To Change PDF Invoice Order Name ?

How TO Change Font Site Of Product Name?


texts: I am in a project which is updating the my customer website from 1.5 to 1.9. I have already searched on the Internet but almost all of guides on there is lack of steps and information. I can't find any guide that helps me upgrade the system in a full and clear way. Please, any one, which has experience about of UPGRADE Magento from 1.5 to 1.9, gives me the full process of this case step-by-step.


texts: How can i get customer data after registration?

texts:
I have the following code but it is not working.

vendorName/moduleName/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="Vendorname_Modulename" setup_version="0.0.1" />
</config>

vendorName/moduleName/etc/frontend/events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  <event name="customer_register_success">
    <observer name="customer_resgister_observer" instance="Vendorname\Modulename\Observer\CustomerRegister" />
  </event>
</config>

VendorName/ModuleName/Observer/CustomerRegister.php

<?php

namespace Vendor\Module\Observer;
use Magento\Framework\Event\ObserverInterface;

class CustomerRegister implements ObserverInterface
{
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    echo "Customer registered";
    $customer = $observer->getEvent()->getCustomer();
    echo $customer->getFirstname();
    echo $customer->getLastname();
    exit;
  }
}

VendorName/ModuleName/registration.php

<?php \Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE, 'VendorName_ModuleName',
__DIR__
);

Does anybody know why is not working?


texts: Magento2 - Translate title property in knockout js html template

texts:
I have href html tag that looks like this in my knockout html template

  <a data-fancybox data-src="#price_policy" href="javascript:void(0);" title="Shipping Cost" data-bind="i18n: 'Shipping will be available in your area'"> </a>

this html tag has title property that i need to translate, how can i achieve this?


texts:
We need to change the category ids on our store.

For example, our category of "automotive" was assigned a category ID of 129 and we would like that category to have the ID 268.

What is the best way to go about this and are there any risks associated?


texts: Is there a way to not charge customer until the order has "shipped"?

texts:
Client requested to have it set up this way a few days before going live. Not sure how to accomplish this. We are using auth.net and fedex shipping. Any ideas?

Essentially take credit card info but don't charge for the product or shipping until the product has shipped or is ready to ship.


texts: How to override /vendor/magento/framework/Logger/Handler/system.php

texts:
I want to override this file

  vendor/magento/framework/Logger/Handler/System.php

Basically I want to disable system.log and exception.log from var/log folder. I found that

  vendor/magento/framework/Logger/Handler/System.php

this file can write in log.

Does anyone know how to override this file ? Thanks in advance.


texts: What is the equivalent of Mage::app() in magento 2, like Magento 1?

texts:
I am Migrating a website from Magento 1 to Magento 2. In Magento 1, I was using

<?php $isReviewScreen = Mage::app()->getFrontController()->getRequest()->getRouteName() == 'review'; ?>

I am trying to get the equivalent of this code in magento 2? Please help me to do it.

Thanks


texts: "Telephone" is a required value in customer edit form

texts:
I have overrided customer edit form. But while saving record I'm getting error message

  "Telephone" is a required value.

I don't want telephone field. So in my form telephone field is not there but still error is coming.


texts: Expiring Digital Certificates for UPS Developer Kit

texts:
Got this message from UPS today.. will this affect Magento 2 site? Any action we will need to take?

URGENT: Expiring Digital Certificates for
UPS® Developer Kit URL
The current Comodo Sectigo server certificate used for UPS Developer Kit transactions submitted to https://onlinetools.ups.com will expire on February 25, 2021.
Beginning February 15, 2021, UPS will update the certificate to the current Comodo Sectigo at which time customers can download the new certificate. The migration will be completed February 19, 2021.
Most customer interfaces will download the certificate automatically. In the event your application uses a separate certificate store you will need to work with your IT resources to update it.
After February 19, 2021 if your certificate has not been updated your UPS Developer Kit API transactions will fail.
If you have any technical questions or concerns, please submit your question to uoltects@ups.com. For general questions, please call 1-800-247-9035.


texts: how to override customer login.phtml file in custom module

texts:
I want to override Customer login form of core files. In customer/account/login xml file I already added my custom file path and override it , but still it is not working.

How can i override form/login.phtml file ?

please help me....

xml => customer_account_login.xml

<referenceBlock name="customer_form_login">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Name_Abc::form/login.phtml
                </argument>
            </action>
        </referenceBlock>


texts: How to create attributes to display icon in list page?

texts:
Am using Magento 1.9.2.4. I want to display icons respective to the products in product list page (i.e. below the 'price'). So I created an attribute with label Iconlist like below,

and I added the attribute in list.phtml like

            <?php echo $_product->getIconlist(); ?>

But am not able to see any changes. Kindly help me.


texts: Can I use another database for media_storage?

texts:
While you can only use MySQL for the main Magento database, you can use Redis and Memcached for fast cache and session storage. This is particularly useful for cluster systems.

So what about for media_storage? According to this post the xml has two interesting nodes: model and type. Where are the possibilities for those nodes defined, and do they imply that I can use another database for media storage?


texts: My form is not showing which i have created under subcategory in magento

texts:
I had created a menu in subcategory and created the form in phtml file when I click on the subcategory link the form is not showing.It is showing the page not found.Please anyone help me.

In admin catalog->Manage categories->add sub category in this I had created the link.

My form

  <form action="http://www.labwise.in/devel/zensearch/order" id="bookingtest" method="post">

            *<?php echo $this->__('Test Name') ?>

                    <input type="text" id="testname" name="testname" value="<?php echo $_GET['name']?>" class="input-text required-entry" title="<?php echo $this->__('Test Name') ?>" />

            *<?php echo $this->__('City') ?>

                        <input type="text" id="city" name="city" value="<?php echo $_GET['city']?>" class="input-text required-entry" title="<?php echo $this->__('City') ?>" />

            *<?php echo $this->__('Location') ?>

                        <input type="text" id="location" name="location" value="<?php echo $_GET['location']?>" class="input-text required-entry" title="<?php echo $this->__('Location') ?>" />

            *<?php echo $this->__('Name') ?>

                        <input type="text" id="cname" name="cname" value="" class="input-text required-entry" title="<?php echo $this->__('Name') ?>" />

         *<?php echo $this->__('Email Address') ?>

                    <input type="text" name="email" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />

            *<?php echo $this->__('Mobile Number') ?>

                            <input type="text" id="mobile" name="mobile" value="" class="input-text required-entry validate-mobileno" title="<?php echo $this->__('Mobile Number') ?>" />

<?php echo $this->__('* Required Fields') ?>

    <button id= "submit"  type="submit" class="button" title="<?php echo $this->__('Book Test') ?>" name="send" id="send2"><?php echo $this->__('Book Test') ?></button>

   </form>

CMS code In content:

{{block type='core/template' name='quickservice' template="quickservice/form.phtml"'}}


texts: footer_links static block not working magento 1.9.0.1

texts:
i'm working with magento 1.9.0.1 with b-responsive theme.there are two static blocks in my backend inside CMS (1) footer_links (2)footer_links_company.
inside my app\design\frontend\b-responsive\enterprise\template\page\html\footer.phtml its is called as:

<?php echo $this->getChildHtml('footer_links') ?>

and here is the content inside that static block:

About Us

Customer Service

Privacy Policy

but when i remove this code then nothing is happening in frontend means the links are showing there after removing this code. i have flush my cache but nothing  happening.

Here is the code inside my page.xml file:

<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
                    Page Footer
                    <action method="setElementClass"><value>bottom-container</value></action>
                </block>
                <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
                <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
            </block>


texts: Magento 2 receiving email from www-data@ip-x-x-x-x.eu-west-1.compute.internal instead of website name

texts:
We are using AWS as a hosting company with magento 2.
Magento 2 welcome email,order email etc...
customer receiving email from www-data@ip-x-x-x-x.eu-west-1.compute.internal instead of "Website name".
how to solve this ?


texts: Update customer attributes of old module

texts:
I have an old module and I need to update it so it will work with a newer Magento version. Basically the module adds some customer fields.

So there a config.xml like this:

<config>
    <modules>
        <DWI_Customer>
            <version>1.0.1</version>
        </DWI_Customer>
    </modules>

    <global>
        <fieldsets>
            <customer_account>
                <membernumber><create>1</create><update>1</update></membernumber>
                ...
            </customer_account>
        </fieldsets>
    </global>
</config>

Notice there is no resources setup config defined but stilll there is a Entity/Setup.php

class DWI_Customer_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
{
    public function getDefaultEntities()
    {
        return array(
            'customer' => array(
                'entity_model'          =>'customer/customer',
                'table'                 => 'customer/entity',
                'increment_model'       => 'eav/entity_increment_numeric',
                'increment_per_store'   => false,
                'additional_attribute_table' => 'customer/eav_attribute',
                'entity_attribute_collection' => 'customer/eav_attribute',
                'attributes' => array(
            'membernumber' => array(
            'label'     => 'Member No',
            'visible'   => true,
                        'sort_order'    => 65,
        ),
            ....
        );
    }
}

With newer version those fields are not visible (but added to eav_attribute) and I need to add an upgrade script like this:

$config->getAttribute('customer', 'membernumber' )
    ->setData( 'used_in_forms', array( 'adminhtml_customer' ) )
    ->save();

I did the with other modules and it worked fine. Problem here is I don't have sql/customer_setup/mysql4.... here. Also it looks like the module does not show up in core_resource or I am not sure how it would be named. customer_setup feels right but that is already been used by Mage/Customer.

Question is: How do I add an upgrade script for this module?


texts: 25% off store-wide + free shipping on all orders

texts: I would like to allow customers to purchase any item/s online and receive 25% off the subtotal + free shipping on their order.


texts: Magento 1.9.0 Magento Connect Manager displays 500 Internal Server Error?

texts: We are using Godaddy server, The server displayed this:


texts: Site is not opening after setting production mode Magento2

texts:
I set mode as production, after that my website gone down,

Is there any setting to be done? All css and js are showing 504 gateway error.

What is the reason for it?


texts: There is a statement that needs to be removed from all products that are in 1 attribute set. It is not located in the short description but is located just below. Thoughts on where I might find and remove that statement?


texts: magnto load css only for url checkout/#payment

texts:
i want to load css file only if URL is checkout/#payment

can I add do via layout XML it tried but it seem not workig


texts: Magento 2.3 remove other shipping methods and enable only free shipping if the amount is more than 99

texts:
Tell me how you can hide the rest of the delivery methods and leave only free if the order amount is more than 99

I tried the implementation that is on the stack for lower versions, it either does not work or is deprecated, I need it for version 2.3

Thanks


texts:
I try to deploy the static content php bin/magento setup:static-content:deploy -f da_DK en_US

But the following error occured.

frontend/Magento/blank/da_DK            2291/2291           ============================ 100% %  13 secs
adminhtml/Magento/backend/da_DK         2161/2161           ============================ 100% %  2 secs
frontend/booking/stylish/da_DK          2043/2322           ========================>--- 87% %   8 secs
PHP Fatal error:  Uncaught Error: Call to a member function getPackage() on null in /home/vhosts/dev_site/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
Stack trace:
#0 /home/vhosts/dev_site/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php(109): Magento\Deploy\Package\Processor\PostProcessor\CssUrls->getValidExternalUrl('{{base_url_path...', Object(Magento\Deploy\Package\Package))
#1 /home/vhosts/dev_site/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php(80): Magento\Deploy\Package\Processor\PostProcessor\CssUrls->parseCss(Array, 'css/email-inlin...', 'frontend/bookin...', '@import url("{{...', Object(Magento\Deploy\Package\Package))
#2 /home/vhosts/dev_site/public_html/vendor/magento/module-deploy/Service/DeployPackage.php(151): Magento\Deploy\Package\Processor\PostProcessor\CssUrls->process(Object(Magento\Deploy\Package\Package), Array)

I have tried the solution from this answer, so I deleted everyting from view_processed, and everything from pub/static as suggested

rm -rf pub/static/*
rm -rf var/view_preprocessed/pub

But it didn't solve my problem.

How can I fix this issue?


texts:
i am a newbie in magento so dont know much about coding and scrippts,

my problem is i have list of SKU's which are end of line now and has been replaced with new products.

i want to delete them so i can free up some space for new products. but doing around 5k of products manually are taking way too much long. is there any way i can delete them in bulk using .CSV or XML import export or dataFlow service?

i am new to all this magento so please if you know the answer tell me in details that which code where exactly need to place.

thank you guys.
i hope some one will be able to help.


texts:
We use the original RWD social share see picture

We have add the LinkedIn Icon and we have open sharing.phtml but we do not know what to insert in the a href=""

<a href="<?php ?>" target="_blank" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Share on LinkedIn')) ?>" class="link-linkedin"><?php echo $this->__('Share on LinkedIn') ?>

Do we need JS?

Module is not a possibility for us.

Thanks!


texts: Memory issues when upgrading from 2.2.6 to 2.3

texts:
I am trying to upgrade from 2.2.6 to 2.3, but the updater doens't even start. I get this message in the log:

PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /vendor/composer/composer/src/Composer/Json/JsonFile.php on line 272

I havem 1024M of allocated memory. What can be the issue?


texts: Event for Add to Wishlist button in Magento2

texts:
I want to redirect User to Observer on Add to Wishlist Click

i want this for guest users

Example
if customer is not logged in then it must redirect user same page

So far i have tried Following Events

 - wishlist_add_product
 - wishlist_add_item
 - wishlist_product_add_after

i am not Getting any solution


texts: Magento 2 and Authorize.net MD5 - What does this mean for Magento 2?

texts:
https://developer.authorize.net/support/hash_upgrade/?utm_campaign=19Q2%20MD5%20Hash%20EOL%20Partner&utm_medium=email&utm_source=Eloqua

Might anyone be able to shed some light on what this means for Magento 2 sites using Authorize? I've had weirdly little success finding any discussion on this.


texts:
I'm trying to add more than one button in my Magento 2 modal. I got it to pop up but I can't seem to get another button to appear. and I adding the second button correctly to the array?

UPDATED CODE!

require([
"jquery",
"Magento_Ui/js/modal/modal"
], function($, modal){
var options = {
    type: 'popup',
    responsive: true,
    innerScroll: true,
    title: "Age verification", //write your popup title
    buttons: [
        {
            text: $.mage.__('Under 21'),
            class: 'under-21 button',
            click: function () {
                console.log('Do something here......');
                // Do something here........
            }
        },
        {
            text: $.mage.__('21+ Enter'),
            class: 'over-21 button',
            click: function () {
                console.log('Do something here......');
                this.closeModal();
                // Do something here........
            }
        }
    ]
};
    var popupdata = $('<div />').append($('#age-check-model'));
    modal(options, popupdata);
    popupdata.modal('openModal');
});

works great now


texts: show discount price on product view after apply coupon code by url

texts:
i wrote an extension to auto apply coupon codes by url. this works great.
now i want to redirect to an url specified by myself where one or some products for this coupon are shown. so my question is: is it possible to process a cart rule on product list.phtml or view.phtml?

my idea is to overwrite Mage_Catalog_Model_Product_Type_Price, here is my class:

public function getPrice($product) {
    $coupon_code = trim(Mage::getSingleton("checkout/session")->getData("coupon_code"));
    if ($coupon_code != '') {
        $oCoupon = Mage::getModel('salesrule/coupon')->loadByCode($coupon_code);
        $salesRule = Mage::getModel('salesrule/rule')->load($oCoupon->getRuleId());

        $item = new Varien_Object();
        $item->setProduct($product);

        $isValid = (bool) $salesRule->getActions()->validate($item);

        if ($isValid === true) {
            //here i want to process the coupon code so the originalPrice and the discountPrice are shown on price box
        }
    }

    return $product->getData("price");
}

is there a way to solve my problem? maybe i did search for the wrong keywords on google ;) could you give me a hint :)

Thx :)


texts: Put CDATA It is a good practice or not necessarily - Magento 1.9

texts:
<script type="text/javascript">
  //<![CDATA[
    Some code...
  //]]>
</script>

We agree that magento use the CDATA in javascript pieces codes, but I would like to know which is really the utility of this. There are some who say that we should put it in the XHTML and XML. So for exemple in some phtml, if i need to add a javascript function to validate some field or add a class etc ... i should add the CDATA between the code or not necessarily.


texts: Unavailable configurable swatches on product page showing available on load until mouseover

texts:
I have searched high and low to try and answer this one but to no avail thus far.

I have show out of stock products turned on through Magento 1.9.3.7 which is all working fine however on product page load all options show as if they are available until the mouse enters the swatch area and then the unavailable ones are then grayed out.

How can I get the unavailable swatches to show grey on page load.

I hope the above makes sense and an example can be seen at http://ooooosh.com/pleaser-adore-7802 for further clarity.

I thank you so much in advance as this is driving me insane! :)


texts:
I have this error that i try to solve in Magento 1.9 and would like help solving it.

2015-03-19T10:09:32+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid blocktype: ' in /home/******/public_html/onlineshop/app/Mage.php:595
Stack trace:
#0 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid blockty...')
#1 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'product_list_to...')
#3 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'product_list_to...')
#4 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#6 /home/******/public_html/onlineshop/app/code/core/Mage/Catalog/controllers/CategoryController.php(148): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#7 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#8 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#9 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home/******/public_html/onlineshop/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home/******/public_html/onlineshop/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#12 /home/******/public_html/onlineshop/index.php(88): Mage::run('', 'store')
#13 {main}
</pre>

The problem should be with:

createBlock('', 'product_list_to...')
addBlock('', 'product_list_to...')

Somewhere is the block type wrong for product_list_toolbar. You can find this in:

app\design\frontend\base\default\layout\tag.xml
app\design\frontend\base\default\layout\catalogsearch.xml
app\design\frontend\base\default\layout\catalog.xml

Where the code is:

         <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                <block type="page/html_pager" name="product_list_toolbar_pager"/>
            </block>
            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
        </block>

Am i searching in the right place? The type seems to be right.


texts: Login with phone number or email address - Magento 1.9

texts:
I created a custom attribute customer "cm_telephone", then i rewrite Customer/controllers/AccountController.php loginPostAction() function to customise it for login with the email or phone number. It works, just I wanted to know what you think about my code.

The code:

public function loginPostAction()
    {
        if (!$this->_validateFormKey()) {
            $this->_redirect('*/*/');
            return;
        }

        if ($this->_getSession()->isLoggedIn()) {
            $this->_redirect('*/*/');
            return;
        }
        $session = $this->_getSession();

        if ($this->getRequest()->isPost()) {
            $login = $this->getRequest()->getPost('login');

            if (!empty($login['username']) && !empty($login['password'])) {

                //the phone number condition
                if (strpos($login['username'], '@') === false){
                    Mage::log('Customer has entered a phone number ');
                    $customer = Mage::getModel('customer/customer')
                        ->getCollection()
                        ->addAttributeToFilter('cm_telephone', $login['username'])
                        ->getFirstItem();
                        if($login['username'] == $customer->getCmTelephone()){
                          $login['username'] = $customer->getEmail();
                        }
                }
                //end phone number condition
                try {
                    $session->login($login['username'], $login['password']);
                    if ($session->getCustomer()->getIsJustConfirmed()) {
                        $this->_welcomeCustomer($session->getCustomer(), true);
                    }
                } catch (Mage_Core_Exception $e) {
                    switch ($e->getCode()) {
                        case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                            $value = $this->_getHelper('customer')->getEmailConfirmationUrl($login['username']);
                            $message = $this->_getHelper('customer')->__('This account is not confirmed. Click here to resend confirmation email.', $value);
                            break;
                        case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
                            $message = $e->getMessage();
                            break;
                        default:
                            $message = $e->getMessage();
                    }
                    $session->addError($message);
                    $session->setUsername($login['username']);
                } catch (Exception $e) {
                    // Mage::logException($e); // PA DSS violation: this exception log can disclose customer password
                }
            } else {
                $session->addError($this->__('Login and password are required.'));
            }
        }

        $this->_loginPostRedirect();
    }

I found this but I didn't want to use an event and I keep the email address and I add the phone.


texts: Magento 2: setdata() is not saving the values into the database

texts:
Controller file

Post.php

<?php

namespace QaisarSatti\HelloWorld\Controller\Index;

class Post extends \Magento\Framework\App\Action\Action

{

    protected $_objectManager;
    protected $hello;

    public function __construct(\Magento\Framework\App\Action\Context $context,
                                \Magento\Framework\ObjectManagerInterface $objectManager,
                                \QaisarSatti\HelloWorld\Model\HelloworldFactory $helloworld)
    {
        $this->hello = $helloworld;
        $this->_objectManager = $objectManager;
        parent::__construct($context);
    }
    public function execute()
    {
        $post = $this->getRequest()->getPostValue();
        $model = $this->_objectManager->create('QaisarSatti\HelloWorld\Model\Helloworld');
        $model->setData('post_id', $post['post_id']);
        $model->setData('title', $post['title']);
        $model->setData('content', $post['content']);
        $model->save();
        $this->_redirect('*/*/');
        $this->messageManager->addSuccess(__('Your values has beeen submitted successfully.'));
    }

}

Model file

QaisarSatti\HelloWorld\Model\Helloworld.php

<?php

namespace QaisarSatti\HelloWorld\Model;

    class Helloworld extends \Magento\Framework\Model\AbstractModel
    {
        protected function _construct()
        {
            $this->_init('QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld');
        }
    }

Resource Module:
QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld.php

<?php

namespace QaisarSatti\HelloWorld\Model\ResourceModel;

use \Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Helloworld extends AbstractDb

{

    protected function _construct()

    {

        $this->_init('sample_posts', 'post_id');

    }

}

Collection.php

QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld\Collection.php

<?php

namespace QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection

{

    protected function _construct()
    {

        $this->_init(
        'QaisarSatti\HelloWorld\Model\Helloworld',
        'QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld');

    }

}

Setup\InstallSchema.php

<?php

namespace QaisarSatti\HelloWorld\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface {

    public function install( SchemaSetupInterface $setup, ModuleContextInterface $context ) {
        $installer = $setup;

        $installer->startSetup();

        $table = $installer->getConnection()->newTable(
            $installer->getTable( 'sample_posts' )
        )->addColumn(
            'post_id',
            Table::TYPE_SMALLINT,
            null,
            [ 'identity' => true, 'nullable' => false, 'primary' => true ],
            'Post ID'
        )->addColumn(
            'title',
            Table::TYPE_TEXT,
            255,
            [ 'nullable' => false ],
            'Post Title'
        )->addColumn(
            'content',
            Table::TYPE_TEXT,
            '2M',
            [ ],
            'Post Content'
        )->setComment(
            'Sample Post Table'
        );

        $installer->getConnection()->createTable( $table );

        $installer->endSetup();
    }
}

I can able to get the values from frontend phtml file using the method getPostValue(). But I can't able to save it. I like to save the values which I get from getpostvalue() method to the database. Please help me.


texts: I am looking to create a bundled product that includes 3 beers. The user should be able to specify, which of our 10 different beers they want to include in the bundled product. They should be able to choose 3 different beers or 3 of the same beer. Is it possible to create this from a default Magento installation and if so, how?