texts: Add button to backend that runs a script

texts:
I would like to add a button to the backend that runs a script. Preferably on the Index Management page under the existing indexing table. Is this a simple procedure?

I have the script and its working I just want the admin users to be able to run it from the backend. I don't want to run it from the browser as it will most probably time out.


texts: Move magento site with redis to server without redis how to disable redis

texts:
I want to copy a Magento site with Redis cache to another server without Redis. Is this possible with just the steps as described here?

Probably that's not enough because it is looking for Redis which is not there.

Edit
I followed the instruction of seanbreeden, but that gives me an error:
Connection to Redis failed after 2 failures.

Below my local.xml file

<config>
    <global>
        <install>
            <date><![CDATA[Tue, 11 Mar 2014 20:31:26 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[xxxxxxxxx]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[magento]]></username>
                    <password><![CDATA[xxxxx]]></password>
                    <dbname><![CDATA[db_magento]]></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>
</config>

And app/etc/modules/Cm_RedisSession.xml

<config>
  <modules>
    <Cm_RedisSession>
      <active>false</active>
      <codePool>community</codePool>
    </Cm_RedisSession>
  </modules>
</config>


texts: Check stock-status of configurable product (display OutOfStock when all child products are out of stock)

texts:
I got the following code to check the status of a configurable product. Basically, the stock status of all child products has to be checked, and as all child products are out of stock, the command would display 'OutOfStock', but the commands not still achieving what I want, since it displays InStock when all child products are out of stock. What could be going wrong?

 <?php
 $_product = Mage::registry('current_product');
 $stockItem = $_product->getStockItem();
 $isInStock = $stockItem->getIsInStock();
 $stockString = ($isInStock ? "In" : "OutOf")
 ;?>

 <script type="application/ld+json">
 {
 "offers": {
         "availability": "<?php echo $stockString ."Stock"; ?>",
     }
 }
 </script>

`


texts: Memory limit when uploading product image

texts:
I just setup a testing installation yesterday. I ran the server-check file and all was fine. Installation went smoothly.

The image upload doesn't work in the Backend! After uploading any image, even as small as 1kb, the error "Memory limit has been reached." appears and the image is not stored.
The memory limit for PHP is set very high (several GiB or even -1 for unlimited)


texts: i click the "process to checkout " button in the cart , it running for a long time to jump the checkout page

texts: After i added the product, then i click the "process to checkout " button in the cart , it running for a long time that can jump to the checkout one-page,i think this question will be make customer wait a long time ,and a large percent maybe make them give up the order.


texts:
Consider i have three blocks on left sidebar namely block_1, block_2 and block_3

i can remove all of the above block by using below code

<remove name="block_1" />
<remove name="block_2" />
<remove name="block_3" />

but i dont want to use above code as blocks in my sidebar are coming dynamically. so i am looking for code which will remove all the block, something like <remove name="all" />


texts: How can I add watermark in all invoice pdf which export for customer order

texts:
I want to add custom text As watermark in order PDF.
I know code is from Here for make PDF But how we can add mask to PDF object?

app\code\core\Mage\Adminhtml\controllers\Sales\OrderController.php

public function pdfinvoicesAction(){
    $orderIds = $this->getRequest()->getPost('order_ids');
    echo '';print_r($orderIds);exit;
    $flag = false;
    if (!empty($orderIds)) {
        foreach ($orderIds as $orderId) {
            $invoices = Mage::getResourceModel('sales/order_invoice_collection')
                ->setOrderFilter($orderId)
                ->load();
            if ($invoices->getSize() > 0) {
                $flag = true;
                if (!isset($pdf)){
                    $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
                } else {
                    $pages = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
                    $pdf->pages = array_merge ($pdf->pages, $pages->pages);
                }
            }
        }
        if ($flag) {
            return $this->_prepareDownloadResponse(
                'invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(),
                'application/pdf'
            );
        } else {
            $this->_getSession()->addError($this->__('There are no printable documents related to selected orders.'));
            $this->_redirect('*/*/');
        }
    }
    $this->_redirect('*/*/');
}


texts: Change "My Account" to "Sign in/Sign out" option in header in magento rwd theme?

texts:
I want to change "My Account" to "Sign in/Sign out" option in header in the upper right corner.

In C:\wamp\www\magento\app\design\frontend\base\default\layout\customer.xml

I changed

<default>

    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer">My Account<url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</default>

to

<default>

    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer">Sign In/Sign Out<url helper="customer/getAccountUrl"/><title>Sign In/Sign Out</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</default>

Still not displaying Sign In/Sign Out....

So how to do?


texts: Magento 2: is it possible to use a for loop in an x-magento-template?

texts:
Using 2.1.3, is there a way to iterate over an array in an x-magento-template?

i.e. (below is not working):

To end up with:

Name: My product

Option 1

Option 2


texts: Magento 2 get base url (current store) in admin static block/page?

texts: How can I get (current store) Base Url in CMS block/page in Magento 2? Actually, I am displaying category names in the footer by using static block. For that how can I give the Category Url links in admin static block?


texts: Show customer custom attribute in company admin grid

texts:
Using magento enterprise on cloud I have created a customer attribute external_id. When a customer account is converted to a company account how do I show a column in the grid for this custom attribute?
My first thought was to create Magento_Company\adminhtml\ui_component\company_listing.xml in a custom module and add my custom column attribute using the Magento\Company\Model\Company\Source\Provider\CustomerAttributeOptions as a datasource, but looking at the code I think I might be barking up the wrong tree.


texts:
I am getting error Invalid use of table with UNION while I am trying to export the Bestsellers report in admin.
Below is the exception report content.

a:5:{i:0;s:31:"Invalid use of table with UNION";i:1;s:1946:"#0 /lib/Zend/Db/Select.php(230): Zend_Db_Select->_join('from', 'sales_bestselle...', NULL, Array, NULL)
#1 /app/code/core/Mage/Sales/Model/Mysql4/Report/Bestsellers/Collection.php(125): Zend_Db_Select->from('sales_bestselle...', Array)
#2 /app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php(241): Mage_Sales_Model_Mysql4_Report_Bestsellers_Collection->_initSelect()
#3 /app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(923): Mage_Sales_Model_Mysql4_Report_Collection_Abstract->load()
#4 /app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(1119): Mage_Adminhtml_Block_Widget_Grid->_exportIterateCollection('_exportExcelIte...', Array)
#5 /app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php(139): Mage_Adminhtml_Block_Widget_Grid->getExcelFile('bestsellers.xml')
#6 /app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Report_SalesController->exportBestsellersExcelAction()
#7 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(257): Mage_Core_Controller_Varien_Action->dispatch('exportBestselle...')
#8 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#10 /app/Mage.php(627): Mage_Core_Model_App->run(Array)
#11 /index.php(110): Mage::run('', 'store')
#12 {main}";s:3:"url";s:167:"/index.php/admin/report_sales/exportBestsellersExcel/filter/ZnJvbT0wOCUyRjE2JTJGMTUmdG89MDIlMkYxNiUyRjE2JnBlcmlvZF90eXBlPXllYXImc2hvd19lbXB0eV9yb3dzPTA=/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Kindly let me know if anyone faces any similar issue.
How this can be fixed?
Any help would be appreciated.


texts: show currency symbol of SAR in both store view

texts:
I have store in two views Arabic and English. if I delete this code from

/home/store/public_html/site/vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml

<numbers>
<currencyFormats numberSystem="latn">
<currencyFormatLength>
<currencyFormat type="standard">
<!-- <pattern>¤#0.00</pattern> !-->
</currencyFormat>
</currencyFormatLength>
</currencyFormats>

the currency code show like ر.س in both store view.

also, I can't find SAR currency in root.xml

I found the path of this symbol "ر.س" in

/home/stor/public_html/m4/vendor/magento/zendframework1/library/Zend/Locale/Data/ar.xml

2- How to be SR or SAR in English view?

3- how to solve this issue without changing in core files?

4- how to change a position of currency yo right? I edit the position to
'position'  => self::RIGHT,in  vendor/magento/zendframework1/library/Zend/Currency.php but it has shown between price.

Magento CE 2.1.9


texts: I got below error on saving product details in magento2

texts: URL key for specified store already exists.


texts: Product Gallery Image Name match show something

texts:
I am trying to check gallery images in Magento 1.9.2.4 store to see if they contain thumb.jpg in the image name. I have inserted the following block in the more views area in media.phtml file:

  <?php foreach ($galleryImages as $_image): ?>
  <?php $thumb = $helpImg->getImg($_product); ?>
  <?php// echo $thumb; ?>
  <?php $mystring = $thumb;?>
  <?php $findme   = 'thumb.jpg';?>
   <?php $pos = strpos($mystring, $findme);?>
   <?php if($pos !== false);?>
   <!-- there is a thumb-->
<?php else:?>
  <!-- there is no thumb-->
<?php endif; ?>
 <?php endforeach; ?>

When I uncomment the echo $thumb, I can see the image url outputting on screen, so I know it's not empty.
I am not seeing any errors in logs, so kind of stumped why it's not working.
All I see on product view page is a partial page that stopped when it hit the media.phtml file.

Thanks


texts: Magento 2 - Admin Create Order. sales/order_create/loadBlock cant retrieve layout with

texts:
When Creating an order via the admin. the forms are being loaded by
http://localhost/project/Admin/sales/order_create/loadBlock/block/shipping_method,totals,billing_method?isAjax=true
this request will load
sales_order_create_load_block_shipping_method.xml
sales_order_create_load_block_totals.xml
sales_order_create_load_block_billing_method.xml

reference would be
Magento\Sales\Controller\Adminhtml\Order\Create\LoadBlock

now if I add this line of code to any of those layouts
    <block name="sample_block"
           class="Magento\Framework\View\Element\Template"
           template="My_Module::order/create/shipping/method/sample.phtml">
         <arguments>
            ........jsLayout args
         </arguments>

    </block>

this will work well if My_Module::order/create/shipping/method/sample.phtml is just a normal html template.
eg.

sample

my problem is when i try to call the jslayout. its not working.

NOTE that the JSlayout is working when refreshing the page(means it was not retrieved via ajax). i tried doing the same in sales_order_create_index.xml and it works so i dont think its a misconfiguration in the layout.
I tried to inspect element after the rendering via ajax. and it stops at

like it reads it as a normal html comment.
does anyone experience loading a layout via ajax call? do i need to create a new layout processor for this one or magento already has one.
im also not that knowledgeable on creating layout processors
I just want to load a JSlayout in on a layout.xml thats being called by sales/order_create/loadBlock via ajax. Thanks


texts:
I'm building a Magento theme that uses only a left column template and a single column template. How do I remove the layout options for a right column template or a three column template in the CMS?

I see that the default page.xml includes this code:

<page_two_columns_right translate="label">
    All Two-Column Layout Pages (Right Column)
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>

        <action method="setIsHandle"><applied>1</applied></action>
        <action method="setLayoutCode"><name>two_columns_right</name></action>
    </reference>
</page_two_columns_right>

<page_three_columns translate="label">
    All Three-Column Layout Pages
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>

        <action method="setIsHandle"><applied>1</applied></action>
        <action method="setLayoutCode"><name>three_columns</name></action>
    </reference>
</page_three_columns>

How do I override these options or remove them?


texts:
As you can see in the attached image, foreach product in my store I have too many rewrite rules.

I would like to have only one rule with the following syntax: mydomain.com/product-category/product-name-sku.html

How can I clear all the rules and make this new one?


texts: Hide data-label="Excl. Tax" Product Page

texts:
For my store I have

  Configuration -> Sales -> Tax -> Price Display Settings -> Display
  Product Prices In Catalog ---> "Including and Excluding Tax"

For all products on my site the price Excl. Tax and price Inc. Tax are displayed.

I would like to remove the Excl. Tax data-label on the product page only. This will allow me my own label which is linked to the product attributes.

The trouble is i cannot stop the Excl. Tax data label from showing.

If I use CSS

.price-container .price-including-tax + .price-excluding-tax, .price-container .weee {
    visibility: hidden;
}

or

display: none;

then both price and label are removed

I would like to avoid having to edit core files if possible

Price Excl. Tax template is generated from

  /vender/magento/module-tax/view/base/templates/pricing/adjustments.phtml

<?php if ($block->displayBothPrices()): ?>
    <span id="<?= /* @escapeNotVerified */ $block->buildIdWithPrefix('price-excluding-tax-') ?>"
          data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>"
          data-price-amount="<?= /* @escapeNotVerified */ $block->getRawAmount() ?>"
          data-price-type="basePrice"
          class="price-wrapper price-excluding-tax">
        <?= /* @escapeNotVerified */ $block->getDisplayAmountExclTax() ?>
<?php endif; ?>

and block is

  /vender/magento/Weee/Pricing/Render/TaxAdjustment.php

Does anyone know how i can hide just the label


texts: Consumer is not authorized to access %resources for Magento2 rest API

texts:
I created a new customer and got the token perfectly but when I try to access any API like

http://myhost.com/index.php/rest/V1/customers/me?Authorization=Bearerhy23vc01x9s1jd2t8gho47g58trllc0b

got the error

<?xml version="1.0"?>
<response>
<message>Consumer is not authorized to access %resources</message>
<parameters>
<resources>self</resources>
</parameters>
  <trace>#0 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest/RequestValidator.php(70): Magento\Webapi\Controller\Rest\RequestValidator-&gt;checkPermissions()
#1 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(80): Magento\Webapi\Controller\Rest\RequestValidator-&gt;validate()
#2 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest.php(299): Magento\Webapi\Controller\Rest\InputParamsResolver-&gt;resolve()
#3 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest-&gt;processApiRequest()
#4 /var/www/myhost.com/public_html/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest-&gt;dispatch(Object(Magento\Framework\App\Request\Http))
#5 /var/www/myhost.com/public_html/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor-&gt;dispatch(Object(Magento\Framework\App\Request\Http))
#6 /var/www/myhost.com/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http-&gt;launch()
#7 /var/www/myhost.com/public_html/index.php(39): Magento\Framework\App\Bootstrap-&gt;run(Object(Magento\Framework\App\Http))
#8 {main}</trace>
</response>

please any help


texts: Magento2 import stock sources successful but no changes made and not showing in import history

texts:
Preconditions (*)

Magento ver. 2.3.4
About 10000 skus, this process has worked many times previously, suddenly stops working.
No new modules or configurations have been done since last time the process worked
Reindex and cron jobs run after every attempt to import.

Steps to reproduce:

Updating stock sources with csv columns and values:

source_code,sku,status,quantity
default,144646,1,10.000

csv is in utf-8 encoding with no unusual characters.

Expected result:

The import is done succesfully and 1 product stock has been updated message shown
Import is registered in import_history table

Actual result:

The import is done succesfully but update message is empty
No registry in import_history table
Product stock remains unchanged


texts: Error on Mage::getModel('catalog/product')->load($sku, 'sku');

texts:
when trying to load a product,

$foundProduct =  Mage::getModel('catalog/product')->load($sku, 'sku');

we get the following error:

Fatal error:
Uncaught exception 'Exception' with message 'Warning: Invalid argument supplied for foreach()
in app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 954' in app/code/core/Mage/Core/functions.php:245 Stack trace:
#0 app/code/core/Mage/Eav/Model/Entity/Abstract.php(954): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/magent...', 954, Array)
#1 app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), '120x180 ES-bale...', 'sku')
#2 app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), '120x180 ES-bale...', 'sku')
#3 updatemagento.php(197): Mage_Core_Model_Abstract->load('120x180 ES-bale...', 'sku')
#4 {main} thrown in app/code/core/Mage/Core/functions.php on line 245

Any ideas what's going wrong?


texts: "Agreements not confirmed." in customer registration

texts:
I try to add an agreement checkbox to the customer registration. For this I added an aggreement in the admin panel at "Sales > Billing Agreements" and selected "On customer registration" at the "Display on" menu.

While checkout, this works fine.

Using the user registration page, no agreements show up and the registration returns "Agreements not confirmed." ("Bedingungen wurden nicht bestätigt.").

From the translation table, I can say that the error message comes from Firegento. So I suspect that a few lines of code containing the agreements are just missing. But which?


texts:
I'm trying to get a Magento REST API example working (Create a simple product as an Admin user with OAuth authentication) from the following link:

http://devdocs.magento.com/guides/m1x/api/rest/introduction.html

However I am receiving the following errors:

It's taken me quite some time to get this far after having to work out how to install OAuth and this part is becoming quite painful as I cannot find any solutions for these errors.

Does anybody have any ideas at all? My code is below if required:

<?php
$callbackUrl = "http://localhost/API.php";
$temporaryCredentialsRequestUrl = "https://ts564737-container.zoeysite.com/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'https://ts564737-container.zoeysite.com/admin/oauth_authorize';
$accessTokenRequestUrl = 'https://ts564737-container.zoeysite.com/oauth/token';
$apiUrl = 'https://ts564737-container.zoeysite.com/api/rest';
$consumerKey = '526ced0202719d14951e1849016d6b3d';
$consumerSecret = 'a06606b73962a0efbafea32af3d89380';

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";
        $productData = json_encode(array(
            'type_id'           => 'simple',
            'attribute_set_id'  => 4,
            'sku'               => 'simple' . uniqid(),
            'weight'            => 1,
            'status'            => 1,
            'visibility'        => 4,
            'name'              => 'Simple Product',
            'description'       => 'Simple Description',
            'short_description' => 'Simple Short Description',
            'price'             => 99.95,
            'tax_class_id'      => 0,
        ));
        $headers = array('Content-Type' => 'application/json');
        $oauthClient->fetch($resourceUrl, $productData, OAUTH_HTTP_METHOD_POST, $headers);
        print_r($oauthClient->getLastResponseInfo());
    }
} catch (OAuthException $e) {
    print_r($e);
}

Thank you for any insight.


texts: Magento 2 updated_at for products not updated

texts:
I am using Magento 2.2 and when a product is updated through the product edit dialogue, it updates the updated_at field.

But when the same is updated through the product list view, where multiple products could be updated, like enable/disable products, it is not changing the updated_at field.

I would like to know when a product has changed from the last sync time.  This makes it harder to find the product as some edits are not updating the time accurately.


texts:
I want an observer to track changes in Quote like when removing products, updating, adding product from frontend and backend as well. This observer should run after magento native code.

There are many events like below which are executed during quote but I am not sure which observer will be fit for my requirement--

sales_quote_remove_item

sales_quote_add_item

sales_quote_product_add_after

sales_quote_item_collection_products_after_load

checkout_cart_add_product_complete

checkout_cart_save_before

checkout_cart_save_after
etc...


texts: I want a language switcher in Magento header to Arabic language. But unfortunately there is no Arabic language extension available so I created  store in Arabic language and added pages in Arabic language. But I want to know what I will do for top links and Magento static text in each page.


texts: Can I send sales emails to different addresses based on cart contents?

texts: The client wants to have all sales emails CC’d to a second address if a certain category of product is in the cart. Is there any way to do this?


texts: Magento 2 Layered Navigation in Advance Search Result

texts:
How can I add Layered Navigation in Advance Search result page(2 Column Left layout)?

How can I dot it?


texts:
I am trying to show the Group prices for each product, a functionality that Magento has but apparently in this theme it does not work, all prices shown are the normal ones. Magento Version 1.9.2.

This is how I load my product views:

$_products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addCategoryFilter($newCategory)
    ->setPageSize(3)
    ->setOrder('position', 'ASC')
    ->addAttributeToFilter('visibility' , Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOT`enter code here`H)
    ->addAttributeToSelect('*')
    ->addFinalPrice()
    ->load();

Then this is my controller code:

foreach ($_products as $_product) {
    $login = Mage::getSingleton('customer/session')->isLoggedIn();
    $productId = $_product->getId();
    $groupPrices = Mage::getModel('catalog/product')->load($productId);
    $groupId    = Mage::getSingleton('customer/session')->getCustomerGroupId();
    $group      = Mage::getModel('customer/group')->load($groupId);

    /* some debug code */
    var_dump($group->getCode());
    $Groupprice = $groupPrices;
    echo $Groupprice;

    if (is_null($groupPrices)) {
        $attribute = $_product->getResource()->getAttribute();
        if ($attribute) {
            $attribute->getBackend()->afterLoad($_product);
            $groupPrices = $_product->getData();
        }
    }

    /* check group price exit or not */
    if (!is_null($groupPrices) || is_array($groupPrices)) {
        foreach ($groupPrices as $groupPrice) {
            if ($groupPrice['cust_group']) {
                echo $Groupprice = $groupPrice['NOT LOGGED IN'];
                echo $Groupprice;
                echo "<br/>";
                echo $GroupIds = $groupPrice['Wholesale'];
                echo $GroupIds;
                break;
            }
        }
    }
}

Thank you for the help.


texts: Multiselect value does not rendered all previously selected value

texts:
I add an admin grid using the below mentioned url. Now I add a multi-select field in the form by editing at App/Code/Webkul/Grid/Block/Adminhtml/Grid/AddRow.php file.It is visible fine. I use implode() function to convert the array into string and the value get stored at database as (1,3,5 ).But When I reopen the form by clicking on 'edit' option, form is loaded but in multiselect field only one value is selected. I need a help in this regard.
Thank you.


texts:
We are using the memcached server for caching the data, when ever we do any changes on configuration files we need to restart memcached server , which leads to the over load on the server.

Is it possible to clear the memcached based on the key value pair or by passing any specific input so that part of the memcached will be cleared.


texts:
I was able to install Baler on my local instance, but I'm not sure if I should install it on production for my clients as Baler is still in the Early Alpha mode.

Is anyone using it on production and is there anything that I should be noticed when installing Baler on production?

Any thought is appreciated.

Thanks in advance!


texts: Why copy right is not showing after adding custom footer in custom theme magento 2?

texts:
Please check the code below default.xml.Here i am using luma as parent theme.

 <?xml version="1.0"?>
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="default_head_blocks"/>
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/logo.jpg</argument>
                <argument name="logo_alert" xsi:type="string">Ashmolean</argument>
                <argument name="logo_ing_width" xsi:type="number">354</argument>
                <argument name="logo_ing_height" xsi:type="number">100</argument>
            </arguments>
        </referenceBlock>

        <referenceBlock name="footer_links" remove="false"> </referenceBlock>

        <referenceBlock name="header.links">
            <referenceBlock name="register-link" remove="true" />
            <referenceBlock name="authorization-link" remove="false" />
            <referenceBlock name="wish-list-link" remove="true" />
            <referenceBlock name="my-account-link" remove="true" />
            <referenceBlock name="authorization-link-login" remove="false"/>
        </referenceBlock>
        <referenceBlock name="header" remove="true"/>

        <move element="catalog.topnav" destination="header-wrapper" after="logo"/>
        <move element="top.search" destination="header-wrapper" after="catalog.topnav"/>

        <referenceContainer name="header-wrapper" >
            <block class="Magento\Framework\View\Element\Template" name="top.line" template="Magento_Theme::html/headersitemenu.phtml" before="-"/>
        </referenceContainer>

        <referenceBlock name="form.subscribe" remove="true" />
        <referenceContainer name="footer-container">
            <block class="Magento\Theme\Block\Html\Footer" name="footer" template="html/footer.phtml"/>
        </referenceContainer>
        <!-- <move element="copyright" destination="footer-container" after="footer"/> -->
    </body>
</page>


texts: Magento 2 : Upgrade Script Alter Column with Foreign Key via API

texts:
In a Magento 2 upgrade script, I wanted to modify (alter) a column to change its comment.

Now that column has a foreign key. Whenever I call the modify column method of the setup class, Mysql reports an error that it can't modify the column because of a foreign key constraint.

What is the correct syntax in the Magento 2 setup-classes API to modify a column's comment where that column has a foreign key constraint?

Code-example of the modify part, type and nullable is exactly the same as for the column when it was created, only the comment is changed. It results in the foreign key constraints error; from a src/app/code/Vendor/ExamplePlugin/Setup/UpgradeSchema.php file:

...

        $connection->modifyColumn(
            $setup->getTable('example_list_item'),
            'list_id',
            [
                'type' => Table::TYPE_INTEGER,
                'nullable' => false,
                'comment' => 'ExampleListID'
            ]
        );

...


texts: Magento 2 : Enable only Paypal Payflow Pro

texts:
How can I enable Paypal Payflow pro in Magento 2. At present when I tried to enable Paypal Payflow pro,then one more payment method PayPal Express Checkout Payflow Edition is also enabled.

Which I dont want.
Please help me for this.


texts: How to get the name of current localecode?

texts:
I need to get the full name (es: "English (United State)") from my store views' locale code in Magento2.

I use

$scopeConfig->getValue('general/locale/value', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $_store->getStoreId());

inside a foreach to get all store views' locale code.

I need to get the fullname(es: "English (United State)") and NOT the LocaleCode (en_US)


texts: display magento2 menu based on the customer login

texts:
Based on the customer login I need to show menu. I'm using the theme/layout/default.xml file to menu.
how to check customer is logged in or not in xml file


texts: Magento2: Tier price higher than regular price

texts:
I figured out that if you set a tier price higher than the regular price, it will show the regular price anyway. Seems this is the "normal" funcionality, always show the lower price if it's possible.

But I need to change this funcionality, for example set a regular price of $10 for a product and $15 for a customer group X.

How can I do it? I don't know what to modify, I looked for getFinalPrice functions, but I don't see clearly where it does this logic of get the lower price.


texts: how `$this` works in magento. and how to use it

texts:
<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <block type="page/html" name="nav" template="nav.phtml" parent="root" />
    </default>
</layout>

I have create a xml. such as this. but I can't use any of the $this-> method in the nav.phtml.
Can some one tell me why? and how to fix it? thanks.


texts: Magento 1.9 - Overriding checkout template

texts:
I'm trying to override the 'payment' step of the magento onepage checkout. I've managed to do this before with the 'billing' step, but this isn't working, and i'm kinda confused as to why. Layouts and template confuse me in general, they're not exactly crystal clear in my head.

My custom package/theme is a copy of RWD.

I have my custom module working, the layout file is declared in the config :

<frontend>
    <layout>
        <updates>
            <mymodule>
                <file>mymodule.xml</file>
            </mymodule>
        </updates>
    </layout>
</frontend>

I'm not sure where the best place to put this layout file is, but I've tried in base or in my current package/theme

Then in this layout file, there's this :

<checkout_onepage_index translate="label">
    <reference name="head">
        <action method="addCss"><stylesheet>mymodule/css/mymodule.css</stylesheet></action>
    </reference>
    <reference name="checkout.onepage.payment">
        <action mathod="setTemplate">
            <template>mymodule/checkout/onepage/payment.phtml</template>
        </action>
    </reference>
</checkout_onepage_index>

In my current package/theme, there's a 'mymodule' folder in templates with the folder structure described above (mymodule/checkout/onepage/payment.phtml).

The payment.phtml file is currently empty, i've tried having it be an exact copy of the RWD payment.phtml as well.

I've fiddled with a few things, putting the files in different places, etc.

My problem is that either nothing happens, or I get this report :

a:5:{i:0;s:121:"Invalid method Mage_Checkout_Block_Onepage_Payment::(Array
(
    [0] => mymodule/checkout/onepage/payment.phtml
)
)";i:1;s:2159:"#0 [internal function]: Varien_Object->__call('', Array)

I'd really appreciate a solution, because I'm fairly confused about the whole custom theme + layout + templates and how i'm supposed to properly override them with a module.


texts: Search product URL as catalog/view/id/213 Magento 2

texts:
I have disabled Use Categories Path for Product URLs, so the product URL

Example: www.example.com/product-url

Which is fine.

But I have added some products which have visibility as search only.

When I am searching these products then search results are fine. But the search products URL is not same as above example.

URL is as www.example.com/catalog/view/id/213.

If I change visibility as catalog or catalog,search then the URL with url-key as exam

How can I change URL as www.example.com/product-url ?


texts:
I have a multistore website in Magento CE 1.9.2.4 in which stores are differentiated in url like:

http://mywebsite.com/store1 &
http://mywebsite.com/store2

Now how to get the above store-specific urls in static block by using the {{store url="store1"}} or {{store url="store2"}}

Right now the above syntax is not working and it fetches the default base url only and not the store-specific one.


texts:
Having buried myself in google looking for resolutions to this bug, and having found none, along with the entirety of this morning debugging trying to work out the problem I am hitting a dead end!

The bug appeared immediately after upgrading to 2.2 (subsequent upgrades to 2.2.1 and 2.2.2 have not resolved the issue), while it worked without issue on 2.1.x

The bug presents itself like below:

require.js:1895 GET static/version1518612075/frontend/ar/<vendor>/en_GB/jquery/ui.js net::ERR_ABORTED

Uncaught Error: Script error for: jquery/ui
  http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:166)
at HTMLScriptElement.onScriptError (require.js:1681)

With the odd smattering of load timeout caused by the same reason.

So interestingly before getting further into depth with this, it works absolutely FLAWLESSLY if left to self-generate the files in developer mode. However, the instant it is deployed in production via static-content:deploy, all of these issues start appearing.

Anyway, in particular the issue is caused by requirejs looking at a completely wrong path, even on stock magento defined modules:

<vendor>/en_GB/jquery/ui.js

It, in fact, should be looking for either of the following:

<vendor>/en_GB/jquery/jquery-ui.js
<vendor>/en_GB/jquery/jquery-ui-1.9.2.js

All of the requirejs-config.js path/maps reference the above (minus .js ofcourse). It is almost like it is breaking down the dependency definition and instead using that to generate a path.

Not the only file that is affected, have Aheadworks, Amasty, other core Magento modules, across the board issue.

It's not the static asset issue with nginx that was fixed in 2.1.x, using the correct nginx config for that.

Wondering if any else has come across this?

Thanks.


texts: How can I edit the "Account" block in my footer?

texts:
I can't find the cms page for it. The block contains :

MY ACCOUNT
ORDERS AND RETURNS

as links and I want to add a link and change the title of "Accounts". What do I have to do?


texts: Magento Dashboard Displaying Different figure in lifetime sales and revenue, is that usual process or having some problem?

texts:
My Magento Site's Dashboard Displaying Different figure in lifetime sales and revenue, is that usual process or it has some problem?

I have no idea whether it has a problem or it is the usual thing as I have seen other site and it is showing the same different figure.

Anyone with the knowledge of Magento dashboard and revenue??

I am using magento-1.5.1.0


texts: Magento keeps randomly logging me out of the admin panel

texts:
I am new to Magento, and have some issue with the admin panel. For some reason, I keep being disconnected from the admin panel, which makes it really hard to change what I want on the website, as I will most of the time have to do it at least twice because I've been disconnected the first times.

Sometimes it disconnect me as soon as I change the page I'm on, some other times I'm be able to stay logged in for a good 15-20 minutes without any issue.

What I've done to try and resolve it

Changed the cookies duration
Changed the cookies path
Cleared the cache / session folders of Magento
Cleared the cookies / cache of my browsers

My cookies storage informations in my DB now looks like that

Do you guys have any idea of what may be causing this issue?

Even if you don't know, thank you for reading this far :)


texts: How to disable a single 3rd party module plugin class in Magento 2?

texts:
3rd party module has a file in the following location: Amasty/Xsearch/Plugin/Framework/View/Page/Config.php.

This file contains a class like this:

<?php

namespace Amasty\Xsearch\Plugin\Framework\View\Page;

use \Magento\Framework\View\Page\Config as NativeConfig;

class Config
{

I would like to disable this single class completely and use the Magento class instead. What is the best approach?

UPDATE:

This is the di.xml for the 3rd party module where Magento\Framework\View\Page\Config is injected:

<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com)
 * @package Amasty_Xsearch
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Amasty\Xsearch\Block\Autocomplete">
        <arguments>
            <argument name="catalogLayer" xsi:type="object">Magento\Catalog\Model\Layer\Search</argument>
        </arguments>
    </type>

    <type name="Magento\CatalogSearch\Block\Result">
        <plugin name="Amasty_Xsearch::result-count" type="Amasty\Xsearch\Plugin\CatalogSearch\Block\Result" />
    </type>

    <type name="Magento\Framework\View\Page\Config">
        <plugin name="Amasty_Xsearch::noindex-nofollow" type="Amasty\Xsearch\Plugin\Framework\View\Page\Config" />
    </type>

    <type name="Magento\Framework\App\Router\NoRouteHandler">
        <plugin name="Amasty_Xsearch::404_redirect" type="Amasty\Xsearch\Plugin\Framework\App\Router\NoRouteHandler" />
    </type>

    <type name="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection">
        <plugin name="Amasty_Xsearch::SortingMethodsProcessor" type="Amasty\Xsearch\Plugin\Catalog\Product\CollectionPlugin"/>
    </type>

    <type name="Amasty\Shopby\Model\ResourceModel\Fulltext\Collection">
        <plugin name="Amasty_Xsearch::SortingMethodsProcessor-shopby" type="Amasty\Xsearch\Plugin\Catalog\Product\CollectionPlugin"/>
    </type>

    <type name="Magento\Search\Helper\Data">
        <plugin name="Amasty_Xsearch::generate_seo_url" type="Amasty\Xsearch\Plugin\Search\Helper\Data"/>
    </type>

    <type name="Magento\CatalogSearch\Controller\Result\Index">
        <plugin name="Amasty_Xsearch::redirect_to_seo_url" type="Amasty\Xsearch\Plugin\CatalogSearch\Controller\Result\Index"/>
    </type>

    <type name="Amasty\Shopby\Controller\Search\Result\Index">
        <plugin name="Amasty_Xsearch::redirect_to_seo_url_shopby" type="Amasty\Xsearch\Plugin\CatalogSearch\Controller\Result\Index"/>
    </type>

    <type name="Magento\Search\Model\Query">
        <plugin name="Amasty_Xsearch::save_query" type="Amasty\Xsearch\Plugin\Search\Model\Query" sortOrder="1" />
    </type>

    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="amasty_xsearch" xsi:type="array">
                    <item name="class" xsi:type="string">Amasty\Xsearch\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">45</item>
                </item>
            </argument>
        </arguments>
    </type>

    <type name="Magento\Framework\View\Page\Config\Renderer">
        <plugin name="Amasty_Xsearch::make-css" type="Amasty\Xsearch\Plugin\View\Page\Config\Renderer" />
    </type>
</config>


texts: On popup after subscribe page got refresh and popup appear again

texts:
I am doing popup in magento2 and my code is like . When I click subscribe button page got refresh and again it appear . So I am in infinty loop . How in magento we make it for 1 time session on home page ?

JOIN THE PARTY

GET 15% OFF YOUR FIRST ORDER*

Subscribers only discounts, first look at new products, and cutting-edges tips

            <?php echo $newsletterHtml; ?>

*Promo code will be emailed to the address you enter, New subscribers only

        <img src='<?php echo $this->getUrl('pub/media/').'cms/image-email.gif'; ?>' />


texts: How are order discounts transfered to invoice and creditmemo?

texts:
I want to copy some attributes from order to invoice and creditmemo, but adjust them dependent on the discount_amount attribute of the target.

I wrote an observer for core_copy_fieldset_sales_convert_order_to_invoice and core_copy_fieldset_sales_convert_order_to_cm but at this point, the value is not set yet. I also could not find any corresponding fieldset configuration in Mage/Sales/etc/config.xml.

So my question is: Where does Magento set these values when it converts orders? And do I need to fall back to sales_invoice_save_before and sales_creditmemo_save_before events or is there a better way?


texts: Magento 2.2.4 - unable to print messages. - New Theme

texts:
I have a Module which processes a Post action, and then redirects.
for example i am trying to overwrite - Magento\Checkout\Controller\Cart\Add

I have used my construct function and my method as below.

 public function __construct
 ( \Magento\Framework\Message\ManagerInterface $messageManager )
 {
   $this->_messageManager = $messageManager;
 }

 public function method( ) {
    ..
    $message = “test message”
    $this->_messageManager->addError($message);
    ..
 }

on frontend , i am unable to render this message.
i have tried adding the below block in default.xml

 <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages"/>


texts: Magneto2.3.1 How to customize checkbox with compare link display on product detail page

texts:
I am using Magneto2.3.1 and i need to customize the default magento compare link on detail page. I want to show checkbox with compare label and if i checked than product compare successfully and if unchecked than not compare.

I shared here screenshots please lookout it:


texts: How to send custom email with custom module to mutiple user in magento 1.9?

texts:
I want send custom email with custom module in magento.I have successfully send email to customer after submit inquiry. now  need to send custom email to admin with diffrent template. i.e customer email template can only send to customer and admin email can only send to admin with relative template after form submit.

following is my IndexController.php

<?php
class Pfy_Contactus_IndexController extends  Mage_Core_Controller_Front_Action{
public function IndexAction() {

  $this->loadLayout();
  $this->getLayout()->getBlock("head")->setTitle($this->__("Contactus"));
        $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
  $breadcrumbs->addCrumb("home", array(
            "label" => $this->__("Home Page"),
            "title" => $this->__("Home Page"),
            "link"  => Mage::getBaseUrl()
       ));

  $breadcrumbs->addCrumb("contactus", array(
            "label" => $this->__("Contactus"),
            "title" => $this->__("Contactus")
       ));

  $this->renderLayout();

}

/**
* Ajax reuest to quote
*/
public function UpdateinfoAction() {

    $email = $this->getRequest()->getParam('email');
    $number = $this->getRequest()->getParam('number');
    $comment = $this->getRequest()->getParam('comment');
    $data = array(
        'email' => $email,
        'number' => $number,
        'comment' => $comment
    );
    $model = Mage::getModel('contactus/contactus'); //for eg. Mage::getModel('catalog/product');
    try {
        $model->setData($data)
            ->save();

             $jsonData = json_encode(array('error' => false));
            $this->getResponse()->setHeader('Content-type', 'application/json');
            $this->getResponse()->setBody($jsonData);
            $this->sendEmail($email, $number);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
function sendEmail($email, $number)
{
templateId = 9;
 $sendername = Mage::getStoreConfig('trans_email/ident_general/name');
 $senderemail = Mage::getStoreConfig('trans_email/ident_general/email');
 $sender = Array('name' => $sendername,
 'email' => $senderemail);
 //recepient

 $email = $email;
 $number = $name;
 $vars = Array();
 $vars = Array('email' => $email,'number' => $number);
 $storeId = Mage::app()->getStore()->getId();
 $translate = Mage::getSingleton('core/translate');
 Mage::getModel('core/email_template')
->sendTransactional($templateId, $sender, $email, $number, $vars, $storeId);
$translate->setTranslateInline(true);
}
}

this is my config.xml file template tag is under  tag.

<template>
        <email>
            <contactus_email_template translate="label"   module="contactus">
                <label>Inquiry Now</label>
                <file>inquiry_now.html</file>
                <type>html</type>
            </contactus_email_template>
         </email>
 </template>

thanks in advance


texts: Invalid Form Key. Please refresh the page. Magento 1.9.3.8

texts:
Ok, I have had this problem before and was able to fix it but now nothing is working for me for some reason.

I changed the web/secure/use_in_adminhtml value from 0 to 1 within the magento configuration the last time I was logged into the admin panel.  I was doing this to test secure connection on my dev site.

Problem: Can't login to my admin account now.  I keep getting the message "Invalid Form Key. Please refresh the page."

I have already tried:

1.)Update the core_config_data table and changed the value from 1 to 0 for path web/secure/use_in_adminhtml

2.) DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain' and
    DELETE FROM core_config_data WHERE path='web/cookie/cookie_path'

3.) Deleted var/cache folder (There was nothing in the folder)

4.) There was no var/session folder to delete

5.) Checked my app/etc/local.xml files and added these 2 lines:

<session_save><![CDATA[files]]></session_save>

<session_save_path><![CDATA[/tmp/session]]></session_save_path>

6.) Cleared Chrome's cookies and cache, tried different browsers.

7.) Even though I have set the value for "web/secure/use_in_adminhtml" to 0, it still goes to an https page when typing in my admin address.  If I remove the "s" and leave it as http it directs back to the https address.

Any other things to try? I'm totally lost.


texts:
What is different between getCollection(); and $product->getData();

$products_collection = Mage::getModel('catalog/product')
**getCollection();
->addAttributeToSelect('*')
->addFieldToFilter('price','5.00');

and

$product->getData();


texts:
What is the relationship between products and categories in Magento?
A. Products may be assigned to zero or more categories
B. Product to category relation is dynamically defined by Catalog Product Rules
C. Each product belongs to zero or one category
D. Each product always belongs to one category


texts: Magento2 which command Run and when to Run

texts:
Kindly Clear Difference Between php bin/magento cache:flush and cache:clean and when they need to Run . which tasks Output to need cache:flush or clean ** and which task need these Commands => **di:compile,setup:upgrade,setup:static-content:deploy

I consume 4 to 5 min to run cache:flush,upgrade and deploy.


texts: How to delete products from frontend using object manager in magento 2?

texts:
I want to delete the products from frontend side, but using object manager.
I does not want to using any registry object.


texts: Troubleshooting TaxJar (M2) Dependency Error

texts:
I want to install TaxJar's M2 extension for Magento 2.3 but the readiness check fails due to a “Check Component Dependency” error. We can't suss it out. Before installing, I got confirmation via TaxJar's magento marketplace support portal:

Jake at TaxJar · a day ago
"Yes, our extension is officially supported for Magento 2.3. We are in the process of updating our Marketplace listing to indicate 2.3 support."

I've reached back out to support but I'm in a hurry. Any tips on troubleshooting this?


texts: Magento SOAP Login gives this error 'Premature end of data in tag html line 2'

texts:
I'm working on an integration with a client website in to my app. for this I use SOAP.

This is the url: http://52.40.180.117/demo/uae_en/

Now the problems.

1) If I use standard SOAP URL as mentioned in Magento SOAP guide I do not get the xml output. Instead I get 404 error

http://52.40.180.117/demo/uae_en/index.php/api/v2_soap/?wsdl - gives 404 error

http://52.40.180.117/demo/uae_en/api/v2_soap/?wsdl - Gives WSDL XML

Why is this? And how can I make it to work with standard URL as given in Magento website.

2) If I use SOAP UI application to test SOAP functions, I get all the function listings. But when I send a request using login function I get following error,

‘SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://52.40.180.117/demo/index.php/api/v2_soap/index/?wsdl=1' : Premature
 end of data in tag html line 2’

Can anyone give any suggestions to fix this issue and make this work please?


texts: Magento 2 how to find corresponding .less file?

texts: Ho to find out the .less file to change the style for some element


texts: How to hide custom created menu in old admin users using ACL?

texts:
In the module, I have created the ACL that is working perfectly for the New Admin Users but that custom admin menu is still visible on the old admin users.
When I resave that old admin user's roles then, it will automatically hide the custom menu from their role.
etc/adminhtml/menu.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
    <add id="Vendor_Module::menu"
         title="Test Menu"
         module="Vendor_Module"
         sortOrder="20"
         resource="Vendor_Module::menu"
    />
    <add id="Vendor_Module::mytest"
         title="Manage Test Menu"
         module="Vendor_Module"
         sortOrder="10"
         parent="Vendor_Module::menu"
         action="test/index/index"
         resource="Vendor_Module::mytest"
    />
</menu>

etc/acl.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
    <resources>
        <resource id="Magento_Backend::admin">
            <resource id="Vendor_Module::menu" title="Test" sortOrder="20">
                <resource id="Vendor_Module::mytest" title="Manage Test" sortOrder="10" />
            </resource>
        </resource>
    </resources>
</acl>

Controller/Adminhtml/Index/Index.php
protected function _isAllowed()
{
    return $this->_authorization->isAllowed('Vendor_Module::mytest');
}

Old Admin User Role didn't have permission

But it still visible in the old admin users

When I resave the old admin users it will work, so anyone has an idea about it, How it will work for all old admin users without resaving?
Thanks in advance!


texts: Get order id by order increment id in Magento 2

texts:
I want to get order id by order increment id. I have this code but it is returning empty value:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$incrId = 100005363;
$collection = $objectManager->create('Magento\Sales\Model\Order');
$orderInfo = $collection->loadByIncrementId($incrId);
$orderId = $orderInfo->getOrderId();
echo $orderId;

What is the wrong with code or I am doing some wrong approach?


texts: Add to Cart Button in Product view page getting 502 Bad get Way error in Magento 2?

texts:
Add to cart button in Product view Page getting "502 BAD GATEWAY" issue, Can anybody face this kind of issue?

I found below issue in error log:-

2020/02/01 04:30:20 [error] 161#0: *27 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 27.6.143.249, server: , request: "POST /checkout/cart/add/uenc/aHR0cHM6Ly9kZXYtdHFzcGl3cS1hb2E3cmZ3eGFhdGpxLnVzLTMubWFnZW50b3NpdGUuY2xvdWQvMTB3LTMwLWNqLTQtc24tY2FzZS1vZi0xMi0xLXF1YXJ0LWJvdHRsZXMuaHRtbA%2C%2C/product/31/ HTTP/1.1", upstream: "fastcgi://unix:/run/app.sock:", host: "dev-tqspiwq-aoa7rfwxaatjq.us-3.magentosite.cloud", referrer: "https://dev-tqspiwq-aoa7rfwxaatjq.us-3.magentosite.cloud/10w-30-cj-4-sn-case-of-12-1-quart-bottles.html"


texts: Magento2: centralize Magento 2 database for development?

texts:
We are working on a project which consists of 4 developers. We want to sync our updates from cms, blocks, settings, product attributes, category and etc. We are planning to install a centralised MySQL database in RDS (Amazon). This works good but the connection is very slow.

We had done a lot to optimise it but still, the centralised database is very slow from local connection and it is not convenient. Do you have any suggestions how should we approach the syncing of admin data (database) across team members?


texts: Magento Magento\Framework\View\Element\AbstractBlock has method getCacheFiletime, it return lifetime of cache in seconds. How it will work with varnish?


texts: customer save before process checkout button click

texts: Hello I want to save new customer on checkout page after filling their information but before process to checkout button clicked. Is their any possibility to save new customer using this method?


texts:
I'm Using SOAP API V2 to develop an Android application, everything looks good so far except the currency, its showing the basic currency USD, how can i change it ?

My Basic Currency is AED, But when i using SOAP its showing in USD everywhere(product price, subtotal, total , discount, shipping),am using ET Currency Manager in my Store.

Using : Magento ver. 1.7.0.2 and SOAP API V1.

Thanks in advance


texts: Create a Bulk products using rest api with rabbitMq custom queue in magento 2.3 beta

texts:
How to publish message to rabbitmq and read message in consumer and create a bulk products in magento while running custom queue in rabbitmq.

I want to create custom module in magento 2.3 beta to track the publisher message and processing message in consumer


texts: Removing reference blocks per website in Magento 2

texts:
If I add the following to any default.xml

<referenceBlock name="minicart" remove="true" />

The Mini Cart is removed. However my question is how do I only remove the reference block for a particular website or store?

At the moment I have a separate theme for each website but wondered if I could set anything on the reference block to enable me to do it direct from 1 default.xml


texts:
I've been failing, trying to add a custom block to my module.
I got the error message :
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid type of block: Cpy\AcquisitionNumeroTelephonne\Block\Form_lb
Exception #1 (ReflectionException): Class Cpy\AcquisitionNumeroTelephonne\Block\Form_lb does not exist

Nevertheless the class is existing :
Cpy/AcquisitionNumeroTelephonne/Block/Form_lb.php
<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Cpy\AcquisitionNumeroTelephonne\Block;

use Magento\Framework\App\Request\Http;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class Form_lb extends Template
{
    /**
     * @var Http
     */
    private $request;

    /**
     * DevisList constructor.
     * @param Context $context
     * @param Http $request
     */
    public function __construct(
        Context $context,
        Http $request
    )
    {
        $this->request = $request;
        parent::__construct($context);
    }
}

And here is the layout definition :
Cpy/AcquisitionNumeroTelephonne/view/frontend/layout/acquisition_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <head>
        <title>Formulaire acquisition</title>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Cpy\AcquisitionNumeroTelephonne\Block\Form_lb" name="formlb" template="Aims_AcquisitionNumeroTelephonne::form/lb.phtml" cacheable="false" />
        </referenceContainer>
    </body>
</page>

I made a cache:clean and cache:flush at the end.


texts: After Magento 1 security upgrade, the install scripts are not working

texts:
After a security version upgrade to version (1.14.3.6) Enterprise all my update scripts don't work.

Whether it's inserting, updating... nothing in the install scripts executes.

Anyone with a similar problem?


texts: Magento2 count # of customers purchasing for first time

texts:
I have a magento 2.2.5 based website and what I want to do is for the current month count the number of people who were logged in as a customer and made a purchase for the first time (first time buyers).

The query I am using below does not seem to return the correct # of orders.
it is giving me some numbers but they seem way to low compared to what I see in the admin panel.

  SELECT num_orders AS OrderCount, count(customer_id) as CustomerCount
         FROM (
                SELECT COUNT(1) AS num_orders, sfo.customer_id
                FROM sales_order_grid AS sfo
                WHERE created_at BETWEEN '2019-01-01' AND '2019-01-28'  AND sfo.customer_id > 0
                GROUP BY sfo.customer_id
              ) AS T
 GROUP BY num_orders ORDER BY 1


texts: Magento2: Notice: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH'

texts:
I have installed Zend OPcache v7.1.30-1+ubuntu16.04.1+deb.sury.org+1 on my ubuntu machine
but on indexing command it shows error  Notice: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH'

please suggest


texts: magento 2: how to get order details from "controller_action_predispatch_sales_order_reorder" event?

texts:
I am using "controller_action_predispatch_sales_order_reorder" event to find out whether an order is reorder or not. Using this event I am able to get original orderId but along with that I want Order details as well which were ordered in the original order.
How can I get that from this event?
I have already tried getOrder(), getProduct(), getQoute(), getAllItems()
everything is coming up as null.
Here is my code
<?xml version="1.0"?>

<!--    Reorder from Admin side-->
<event name="sales_convert_order_to_quote">
    <observer name="admin_reorder" instance="VoltLighting\OrderInfo\Observer\AdminReorder"/>
</event>

<!--    Reorder from customer side-->
<event name="controller_action_predispatch_sales_order_reorder">
    <observer name="customer_reorder" instance="VoltLighting\OrderInfo\Observer\CustomerReorder"/>
</event>

<event name="checkout_onepage_controller_success_action">
    <observer name="customer_reorder_success" instance="VoltLighting\OrderInfo\Observer\CustomerReorderSuccess"/>
</event>

<event name="checkout_cart_product_add_after">
    <observer name="customer_predispatch_cart" instance="VoltLighting\OrderInfo\Observer\CustomerReorderCart"/>
</event>

Here is my Observer file
<?php

namespace VoltLighting\OrderInfo\Observer;
use Magento\Customer\Model\Session;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class CustomerReorder implements ObserverInterface
{
protected $customerSession;
public function __construct(Session $customerSession)
{
$this->customerSession = $customerSession;
}
public function execute(Observer $observer)
{
    $order = $observer->getEvent();
    $entity_id = $order->getRequest()->getParam('order_id');
    $customer = $this->customerSession;
    $parentOrder = [$entity_id, []];
    $customer->setMyValue($parentOrder);
}

}


texts: Cart not clearing after checkout due to observer file

texts:
I have a problem where cart do not empty after checkout when Bank transfer payment is used.

I found the reason to be due an observer.php file of anther payment (hyperpay).

if I delete this file, this problem will be solved, however I will get another problem where cart will be emptied before a successful payment is made when hyperpay payment is used.

I believe this observer is missing something like if condition, to make it only applied when hyperpay payment is used.

Can anyone advise for a solution ?

here is observer.php

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 *
 * @package     Hyperpay
 * @copyright   Copyright (c) 2014 HYPERPAY
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Order success observer
 *
 */
class Hyperpay_Model_Success_Observer
{

    /**
     * Reactivate the cart because the order isn't finished
     *
     * @param Varien_Event_Observer $observer
     */
    public function activateQuote(Varien_Event_Observer $observer)
    {
        $observer->getEvent()->getQuote()->setIsActive(true)->save();
    }
}


texts: Change product price based on choosen weight

texts:
is that possible to change easily the price based on product weight ? And is that possible to select product weight ?

Let me explain :

My website will sell for example some flour in bag of 25kg. But I want, on the same page, to allow the customer to choose what weight he wants (if he want's so buy 2kg, 8,4kg or 9,9999kg).

How can I do that, knowing that I need the product SKU has to be the same than the 25kg product.


texts: How to edit font size of product title in catalog page

texts: I need to edit the font for the product titles in the catalog page. I believe it is referenced by "product-item-link" or "product-item-name" ?


texts: Magento 2: How can i get invoice_id of a order with API REST?

texts:
I need the invoice_id of a order and I don´t find a api request to do this.
Any idea?


texts: Is there a way to have Mobile Number and Home Telephone Number in Billing address step?

texts:
I wanted to add an additional field or remove the "Fax" field in Magento Onepage checkout.

Has anyone had to do something similar?

If anyone could share with me how I can change or add these fields so they they appear in Customer account page, Sales_Order/View page and invoices etc I would be very thankful.


texts: Move element XML not working (Magento 2)

texts:
I am editing my theme default.xml in a child theme I have created. Which sits in mytheme\Magento_Catalog\layout\default.xml This file works fine as parts of what I have done does work. Basically what I have done is created a new container category.header and then thrown category.image and page.main.title in it. This works as I can see the items in the new container in my category pages.

The bit that doesn't work that is driving me mad is moving the new container, category.header. Moving the element just doesn't seem to have an affect. All I want to do is move it below the nav and above the main content. Can anyone spot why?

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header-wrapper">
            <container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper">
                <block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml">
                    <arguments>
                        <argument name="jsLayout" xsi:type="array">
                            <item name="components" xsi:type="array">
                                <item name="compareProducts" xsi:type="array">
                                    <item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
                                </item>
                            </item>
                        </argument>
                    </arguments>
                </block>
            </container>
        </referenceContainer>

        <referenceContainer name="page.wrapper">
          <container name="category.header" as="categoryHeader" htmlTag="div" htmlClass="category-header" before="page.main" />
        </referenceContainer>

        <move element="category.image" destination="category.header" />
        <move element="page.main.title" destination="category.header" />

        <move element="breadcrumbs" destination="columns.top" after="category.image" />

        <referenceBlock name="catalog.compare.sidebar" remove="true"/>

    </body>
</page>


texts: Language switcher removes url store code

texts:
When I change language via the language switcher, the url changes for the corresponding url in the other language, but the url store code disappears from the url. Here is an example :

Starting url : example.com/fr/product-fr
Switcher url : example.com/fr/product-fr?___from_store=fr
Final url : example.com/product-en
Expected url : example.com/en/product-en

My settings:
System->Configuration->Web->Add Store Code to URLs = Yes

Thanks for your help!


texts: Add custom add to cart button to product details page below add to cart section

texts:
i need help to add to custom add to cart button on products page below the products detail section..
i tried this code in custom_addtocart.phtml page

i am here

getCurrentCategory()): ?>

        getName(); ?>

 where i write i am here..i add add to cart button here


texts: Why do classes use a helper for translation instead of $this?

texts:
In core modules and sometimes templates, I see helper classes being used for translation:

Mage::helper('someModule')->__('translate me');

Why is this preferable to:

$this->__('translate me');


texts: Importing product images from URL problem

texts:
I'm trying to import some products from a csv with images that are stored on an external server. The images are saving to the var/import folder ok but they won't assign to the product. I'm using the google logo to test.
The exception.log file says:
main.CRITICAL: File 'var/import/googlelogo_color_272x92dp.pnggooglelogo_color_272x92dp.png' was not found or has read restriction. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): File 'var/import/googlelogo_color_272x92dp.pnggooglelogo_color_272x92dp.png' was not found or has read restriction. at /home/account/public_html/vendor/magento/module-catalog-import-export/Model/Import/Uploader.php:210)"} []
See how it's concatenating the file name twice? What's going on?
The import works fine if I use a local path but goes screwy when I put an external url in the source.
For the record the image source is:
https://www.google.co.uk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png

I've tried the same file on a different installation of 2.3 and got the same result. The same file worked perfectly on 2.2.6


texts:
I'm working on Magento 1.7 (I know - in process of upgrading to 2) and made a custom form as a Magento plugin. Everything upto the redirect works - but I'm not sure why or how to debug.

This is my sendEmail() function:

$mail = Mage::getModel('core/email');

$mail->setBody($this->emailHtml($code));
$mail->setFromName('MPW Site');
$mail->setToEmail($to);
$mail->setSubject('Thank You For Registering Your Atom Battery');
$mail->setType('html');

try {
    $mail->send();
    Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
    $this->_redirect('custom-page-?code='. $code);
} catch (Exception $e) {
    Mage::getSingleton('core/session')->addError('Unable to send');
}

However, this snippet results in a White Screen of Death - so I put this in my index.php file to try and debug:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);

register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo("<pre>");
    print_r($error);
}

but still - nothing on screen. var/log also hasn't got any files with a last edit timestamp of today on so I'm really not sure how/why the code is going askew. From what I read online, that redirect should work.

How do I redirect to a CMS page after my form submits?


texts:
I'm trying to retrieve products(which are in order) from order id but it's not working.  Here is the code:

namespace My\Trackorder\Controller\Index;

use Magento\Framework\App\Action\Context;

class Result extends \Magento\Framework\App\Action\Action
{
    protected $resultFactory;
    protected $orderRepository;
    private $orderFactory;
    public function __construct(Context $context,
         \Magento\Sales\Model\OrderFactory $orderFactory,
         \Magento\Framework\Json\Helper\Data $jsonHelper,
         \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
        \Magento\Framework\View\Result\PageFactory $resultFactory
        )
    {
        $this->jsonHelper = $jsonHelper;
        $this->resultFactory = $resultFactory;
         $this->orderRepository = $orderRepository;
        $this->orderFactory = $orderFactory;
        parent::__construct($context);
    }

    public function execute()
    {

        $order_id = $this->getRequest()->getParam('order_id');

        $order = $this->orderFactory->create();
        $order->loadByIncrementId($order_id);
$product = $order->getAllVisibleItems();


texts: Is there a way to Capture less than what was originally authorized? We sell products that face a tariff on steel and aluminum products coming from China. We would like to authorize the product for the amount to include the tariff but once we fill the order from our vendors we will only then know if the tariff applies. When that does we would like capture the amount without the 10% tariff.


texts:
I've added a second checkbox to terms and conditions, but that is not validating.

What I've done:

I've serached and found that, iIt was or is still an magneto2 bug, but found this: https://github.com/bka/magento2/blob/6d172c93a8deaccb0b5d1449cd3b7dc6fc9e8626/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js
I've added this code but it isn't working.

After adding the code I tried following command:

php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

It's still not working.

Can Someone help with adding exact code that I have to replace?

Thanks in advance.


texts:
This is what I'm trying to achieve:

I have 2 radiobuttons:
1. Order per item
2. Order per box (6)

Under those radiobuttons, theres a textbox. People need to fill the amount in that field. When I select the first radiobutton, everything I enter in the textbox goes per item. When I select the second radiobutton, everything I enter in the textbox goes per 6 items. So when I selected the second radiobutton and enter 2 in the textbox, it's supposed to order 12 items of the product.

Is there a way to achieve the above with an extension or module or any other way?

Thanks in advance!


texts: Add order comments to invoice/shipment pdf

texts:
Files controling invoice/shipment order pdf content are the following:

vendor/magento/module-sales/Model/Order/Pdf/Invoice.php
vendor/magento/module-sales/Model/Order/Pdf/Invoice.php

Is it possible to add order comments in these pdf prints?


texts: Magento 1.9: How to pass a variable from controller to setTemplate block?

texts: I have to pass a variable to a block .phtml file. I am setting layout in the controller by setTemplate() function. Do you have any idea?


texts: how to solve the magento 2.2.1 checkout page reponse for a long time question?

texts:
Recently i develop a new site, it used the magento 2.2.1 vesion. Now i test the site that i found the checkout one-page loading  very slow! I don't know the reason? Some people tell me the magento 2.0 vesion oneself  reason, but i think that if i doesn't correct this question maybe make my  customer feel not comfortable, they will leav my site. I have via google to search the answer and help, but i couldn't found the good idea. So I think maybe you can help me to solve it?I need your help? This is my site:   http://supwatch.com/
Below the image, your can try it!


texts:
I need your advice on the next step up from shared servers to manage our large catalogue of products on our magento 1.9 site.

We currently at the moment don't warrant spending the money just yet on a dedicated managed server so I have been looking in to VPS & Cloud servers.

We have a catalogue of around 1500 products, but currently cannot add anymore onto our server as the quota is full.

Would a VPS server be ok? The one I have been looking at has a spec of:

  2 vCores Intel Xeon Processors

  RAM 4GB

  Storage 120GB

  Traffic Unlimited

  Data Centre: United Kingdom

  OS: Linux Ubuntu 16.04

Is this a good stable package to handle our catalogue and site?


texts: Magento2 : How disable some specific values in Multi-select UI component

texts:
I am setting some values in multi-select to be disabled based on some condition

This is how I am declaring my UI component

<field name="category_option">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Mycompany\Stores\Model\Category\Attribute\Source\CategoryOptions</item>
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" translate="true" xsi:type="string">Category Option</item>
                    <item name="formElement" xsi:type="string">multiselect</item>
                    <item name="source" xsi:type="string">category_option</item>
                    <item name="sortOrder" xsi:type="number">60</item>
                    <item name="dataScope" xsi:type="string">category_option</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

And passing values using

public function toOptionArray()
    {
        $categories = $this->_helper->getTestCategoryOptions();
        $testArr = [];
        foreach($categories as $category){
            $testArr = array_merge($testArr,$category);
        }
        foreach($testArr as $test){
            switch($test['label']){
                case 'case1':
                    $result[] = ['value' => $test['label'], 'label' => strtoupper($test['label']), 'disabled'=>""];
                    break;
                case 'Food City':
                    $result[] = ['disabled'=>'disabled','value' => $test['label'], 'label' => strtoupper($test['label'])];
                    break;
                case 'case2':
                    $result[] = ['value' => $test['label'], 'label' => strtoupper($test['label'])];
                    break;
                case 'case3':
                    $result[] = ['value' => $test['label'], 'label' => strtoupper($test['label'])];
                    break;
                case 'case4':
                    $result[] = ['value' => $test['label'], 'label' => strtoupper($test['label'])];
                    break;
                default:
                    $result[] = ['value' => $test['value'], 'label' => $test['label']];
            }
        }
        return $result;
    }

in above code I even tried  'disabled'=>'disabled' , 'disabled'=>'true' but no effect on UI component


texts: Reindexing not working? no errors but search and some categories not working

texts:
it appears that every few days or weeks my webshop is missing some categories and the search is not working anymore. The search gives no results.
Everything works fine again after I reindex using CLI. How can i fix this permanently?
The cron:run cronjob seems to be set up correctly. It says "Ran jobs by schedule." in the log file.
Can you tell me what I am missing?
Thank you for taking the time,
Marvin


texts: Module with database. no table in database

texts:
I will like a module that create a database, and i got it to work with this code

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table emailorder(emailorders_id int not null auto_increment, name varchar(100), primary key(emailorder_id));
    insert into emailorder values(1,'emailorder1');
    insert into emailorder values(2,'emailorder2');

SQLTEXT;

$installer->run($sql);
//demo
//Mage::getModel('core/url_rewrite')->setId(null);
//demo
$installer->endSetup();

Then i wanted more cells in my table so i deleted it and tried this code

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table emailorders(
    emailorders_id int not null auto_increment,
    primary key(emailorders_id),
    order_date datetime NOT NULL,
    location varchar NOT NULL,
    date_for varchar NOT NULL,
    name_title varchar(100) NOT NULL,
    email varchar NOT NULL,
    company varchar NOT NULL,
    address varchar NOT NULL,
    zipcode varchar NOT NULL,
    city varchar NOT NULL,
    phone varchar NOT NULL,
    comment text NOT NULL default,
    order_executed boolean NOT NULL default

);
    insert into emailorders values(1,'emailorders1');
    insert into emailorders values(2,'emailorders2');

SQLTEXT;

$installer->run($sql);
//demo
//Mage::getModel('core/url_rewrite')->setId(null);
//demo
$installer->endSetup();

It does not work and now the first code don't work either :(

What am i doing wrong?


texts: How to have top navigation links by type, finish, style, etc?

texts:
We are looking to improve our top navigation menu so that we can offer customers different ways to find products on our site. Currently we have the following top navigation structure:

Category 1
Category 2
Category 3

Now we would like to enhance this to offer customers the following top navigation options eg:

Shop By Product

Category 1
Category 2
Category 3

Shop By Room

Room A
Room B
Room C

Shop By Type

Type 1
Type 2
Type 3

The same products would appear within each menu but with a different route to finding items depending on how the customer prefers to browse for products (eg by room, type, etc).

Can someone suggest the best way to do this?


texts: In this code what this customer parameter means

texts:
In this code what this customer parameter mean

$this->helper('customer')->getRegisterPostUrl();


texts: Magento 2.3.3 Varnish Cache invalidating and auto purging every 10 minutes

texts:
I have just implemented Varnish 6.0 on our Magento 2.3.3 install, everything seems to be working fine except our Magento cache/varnish cache is being flushed by Magento every 10 minutes.

I can see cache a lot of caches invalidate entires in debug.log. Obviously this is no good for Varnish implementation with it being purged every 10 minutes. I have disconnected the purge connection between Magento and Varnish via env.php now we have Varnish caching long and not being purged by Magento every 10 minutes but no option to manually purge through Magento admin.

We have a few third-party extensions installed but debug.log does not give us any indication as to which module is triggering the invalidation.

Does anyone have any similar experience or know where to start debugging this issue?

Thanks


texts: Magento 2.0 vs Magento 2.1: changes in the grid UI component

texts:
I upgraded from 2.0 to 2.1 recently and I had to refactor my custom UI component grid to get it working properly.

However, I didn't keep track how what I've done so I can't answer my own question.

I noticed that quite some changes had been done to the grid UI component thus I would like to know what are those changes ?


texts:
OK so I have a function as an extension to the firecheckout module to check if the email entered exists as a customer account...

I've basically followed the steps found on this url (Solution 1)..
http://www.helpsforcoder.com/magento/31953-check-for-customer-email-address-exists-in-checkout.html

I've added that function to the file at...

/app/code/local/TM/FireCheckout/controllers/IndexController.php

Within class TM_FireCheckout_IndexController extends Mage_Checkout_OnepageController

But when I try to call the function over ajax I get the html for a 404 page in the alert... here's my JavaScript function...

jQuery('input[title="Email Address"]').blur(function(){
    var email = jQuery(this).val();
    new Ajax.Request("<?php echo $this->getUrl('firecheckout/index/checkEmailexists');?>", {
           method: 'Post',
           parameters: {'billing[email]':email},
           onComplete: function(transport) {
               alert(transport.responseText);
           }
       });
});

here's the IndexController.php
SE wouldnt let me post the whole file... too big so I've removed other functions...

  <?php

require_once 'Mage/Checkout/controllers/OnepageController.php';

class TM_FireCheckout_IndexController extends Mage_Checkout_OnepageController
{
    protected $_updateCheckoutLayout           = null;
    protected $_shippingMethodDependsOnAddress = null;
    protected $_totalDependsOnShippingAddress  = null;

//other native functions go here...

        public function checkEmailexistsAction()
    {

    if ($this->_expireAjax()) {
        echo 'Ajax Expired';
        return;
    }
    if (!$this->getRequest()->isPost()) {
        echo '!isPost';
        return;
    }

    $websiteId = Mage::app()->getWebsite()->getId();
    $data = $this->getRequest()->getPost('billing', array());
    $email = $data['email'];

    $customer = Mage::getModel('customer/customer');

    if ($websiteId) {
        $customer->setWebsiteId($websiteId);
        }

    $customer->loadByEmail($email);

    if ($customer->getId()) {
        // This is the part of the code that runs when a customer exists ...
        return true;
        }
    else {
        // This is the part of the code that runs when a customer does not yet exist ...
        return false;
    }
    }
}


texts: Magento2 Trigger ajax call after Full page load

texts:
I am using Magento 2.2.1, I am trying to trigger ajax call after Full page load. I tried with below scripts but no luck. Did anyone faced this issue and found any solution for it.

window.load
document.ready
<script type="text/x-magento-init">


texts: Tax Set Up For UK Business with USA Site Despatching to EU

texts:
We have 3 stores operating from one admin panel.   We are a UK based business and we sell Globally.   We have set up all the VAT rules and everything is working as we would expect it to other than the USA site - we also have an AUS site that is working as it should be.

With AUS and USA - any customers who buy from these sites for deliveries to these countries or anywhere else outside the EU Zone we dont have to account for VAT.

If however on the rare occasion someone orders from these sites for delivery to the UK or any other EU Member State we need to account for VAT.   We have configured the tax for AUS and all this works.   We have now tried to apply the same for the USA and we cannot get this to work - is this related in anyway to Magento being a USA platform.   For reference we are using the community edition.   If anyone can help that would be appreciated.


texts: Add new option button is not working in product custom option tab

texts:
I want to add a custom option for a product.

When I go to the custom option tab and click on add new option button, then nothing happens. I have also checked in the console but I couldn't find any errors there. Can anyone have any idea, how to solve this ?


texts: find core file code where import data reading from csv file

texts:
Hello developers,

I need little help,Magento is providing import/export data for products,customers using csv files.

When I go System > Import/Export > Import ,select products for Entity types and import product *.csv file and it successfully imported.But my question is where is code in core files where read and write data one by one from csv file for products.I tried to find in app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php and in this ImportController.php file I show startAction() method I also show importSource() method in Mage/ImportExport/Model/Import.php file I can not find fetch data from csv file.I effort but I could not success to find code in core files.Please help me.


texts: Invalid server response Magento connect on upgrade

texts:
I'm trying to upgrading Magento from 1.8 to 1.9.
But for some reason it is not working.

I'm getting this error on initial setup:

/mage mage-setup .
Running initial setup...
Success
Success
Error:
channel-add: Invalid server response for http://connect20.magentocommerce.com/community

I also tried to install Mage_All_Latest

./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
Checking dependencies of packages
Error:
install: Package community/Mage_All_Latest failed: No releases for 'Mage_All_Latest', skipping

What to do? I can't do any upgrade now. List upgrades is saying that I don't have any upgrades available.


texts: Magento 2. How to get path to sales email in code?

texts:
I got the following two pieces of code:

$bccEmail = $this->scopeConfig->getValue('trans_email/ident_general/email');

->addBcc($bccEmail)

The meaning is to send a bcc to the email that is stored on 'Send Order Copy To: '  in Stores -> Configuration -> Sales -> Sales Emails -> Order -> Send Order Email Copy To:

Still I do not receive any bcc. What am I doing wrong?


texts: Importing bundles with Magmi... Easiest way?

texts:
Lost all my bundles... Created an excel sheet of all my bundle skus, and the sku that needs to be bundled in it.

Wondering the easiest way to upload a bundle in Magmi. I see a bunch of way that incorporate coding the crap out of cells...I see a bunch of paid extensions that basically do that same thing, nothing that automatically formats.

I attached my CSV wondering if someone could show me how I could format it so when I upload the colummn "att_rootsku" is bundled inside the sku column.

This is what my csv looks like. Any help would be greatly appreciated....


texts: Magento 2 invoice pdf for COD orders before payment

texts:
Is there's any way to get invoice print in magento 2 before actually invoicing the order.
This is needed for cash on delivery order as invoice copy need to sent to customer with order to customer in cod.
If the shipping is successful and payment is received, then admin would mark the order as complete.

Ps: I am still confused with COD payment order flow in magento 2. I need help to accomplish the proper order flow for COD orders processing. The above might be solved with custom order status. Need guidance regarding order processing flow for COD orders in magento 2.

Thanks in advance.


texts: How to check applied patches in magento 2

texts:
Is there a way in Magento 2 to check the applied patch status?

Just like we can check the patch status in Magereport in Magento 1?


texts: How to hide html file on checkout for certain condition?

texts:
I want to hide checkbox if amount is 0 otherwise show.

I tried,
In html template

            <input type="checkbox" id="apply-credit"
                    class="action"
                    data-bind="click: applyCredit">

In js file

  checkBalanceAmount: function (amount) {
        if(amount > 0)
            balance_amount = 'success';
        else
            balance_amount = '';
        return balance_amount;
    }


texts:
I'm trying to debugging SOAP API. I'm logging call Requests,
but how would I get log on Response?

I have tried to use Magento-API-Logger to get Response I've added

$logger->log($this->getResponse(), $logger::API_V2_SOAP);

to the V2/SoapController, but that gets response without body and it's not XML

DEBUG (7): Mage_Core_Controller_Response_Http Object
(
    [_body:protected] => Array
        (
        )

    [_exceptions:protected] => Array
        (
        )

    [_headers:protected] => Array
        (
            [0] => Array
                (
                    [name] => Content-Type
                    [value] => text/html; charset=UTF-8
                    [replace] =>
                )

            [1] => Array
                (
                    [name] => X-Frame-Options
                    [value] => SAMEORIGIN
                    [replace] => 1
                )

        )

    [_headersRaw:protected] => Array
        (
        )

    [_httpResponseCode:protected] => 200
    [_isRedirect:protected] =>
    [_renderExceptions:protected] =>
    [headersSentThrowsException] => 1
)

Any Suggestions how to get response log?


texts: call core php file function in magento 2 controller

texts:
I am working on a API integration in magento2. That API have two php file with there own functions, that I want to call in our controller to implement respective process.
I have placed that API library files in parallel with our controller file like  -

Our controller - app/code/Mycompany/CustomerAttribute/Controller/Coral/test.php

And library core php files -
app/code/Mycompany/CustomerAttribute/Controller/Coral/Lib/fileOne.php
app/code/Mycompany/CustomerAttribute/Controller/Coral/Lib/fileTwo.php

in our test.php controller file I am calling above files as -

use Magento\Customer\Model\Url;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\Area;

use Magento\Framework\Event\ObserverInterface;

**require 'Lib/fileOne.php';**

and trying to create object like this  -

$obj = new FileOne(array(
                        'appId' => $AppId,
                        'key' => $Key
                    ));

But after executing above statement its showing nothing;

Is this a right approach or I am doing something wrong in current method ?


texts: Overriding protected function in Magento 2

texts:
I'm trying to override one protected function in Magento 2, but I am not able to achieve it.
I have edited following files.

  di.xml

<preference for="Magento\Checkout\CustomerData\DefaultItem" type="XYZ\Checkout\CustomerData\DefaultItem" />

  XYZ\Checkout\CustomerData\DefaultItem

<?php

namespace \XYZ\Checkout\CustomerData;

class DefaultItem extends \Magento\Checkout\CustomerData\DefaultItem
{

    protected function doGetItemData()
    {
        $imageHelper = $this->imageHelper->init($this->getProductForThumbnail(), 'mini_cart_product_thumbnail');
        return [
                'options' => $this->getOptionList(),
                'qty' => $this->item->getQty() * 1,
                'item_id' => $this->item->getId(),
                'configure_url' => $this->getConfigureUrl(),
                'is_visible_in_site_visibility' => $this->item->getProduct()->isVisibleInSiteVisibility(),
                'product_name' => $this->item->getProduct()->getName(),
                'product_sku' => $this->item->getProduct()->getSku(),
                'product_url' => $this->getProductUrl(),
                'product_has_url' => $this->hasProductUrl(),
                'product_price' => $this->checkoutHelper->formatPrice($this->item->getCalculationPrice()),
                'product_price_value' => $this->item->getCalculationPrice(),
                'product_image' => [
                        'src' => $imageHelper->getUrl(),
                        'alt' => $imageHelper->getLabel(),
                        'width' => $imageHelper->getWidth(),
                        'height' => $imageHelper->getHeight(),
                ],
                'canApplyMsrp' => $this->msrpHelper->isShowBeforeOrderConfirm($this->item->getProduct())
                && $this->msrpHelper->isMinimalPriceLessMsrp($this->item->getProduct()),
        ];
    }
}

After clearing caches, when I add product to cart, there is no increment in minicart notification and I'm not able to open minicart and checkout/cart page is coming blank. I have checked in quote_item table and product has been added to the cart. So I think my overriding is not working.


texts: Where to look for varnish pagecache test error reports on Magento marketplace extension submission?

texts:
I am not able to locate or find or download the below error report. Only It list system.log messages on the error report

    Cannot update product price. Response: {"messages":{"error":[{"code":500,"message":"Server internal error. See details in report api/315555012318"}]}}


texts: Magento 2 - Cannot reindex Catalog rule product and catalog product rule

texts:
I get the following error when I try to reindex

when I check index status...

Design Config Grid:                                Ready
Customer Grid:                                     Ready
Category Products:                                 Ready
Product Categories:                                Ready
Product Price:                                     Ready
Product EAV:                                       Ready
Stock:                                             Ready
Catalog Rule Product:                              Reindex required
Catalog Product Rule:                              Reindex required
Catalog Search:                                    Ready


texts: Move Checkout Agreements from top to end of the page

texts:
I am trying hard to move the checkout agreements in the last Checkout Step from the top of the page to bottom, right above the "order now" and "edit cart" buttons. But without success.
Right now they are placed at top of the

frontend/mytheme/default/template/checkout/onepage/review/info.phtml.

But moving or commenting out the

<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>

in the checkout.xml of "mytheme" does not seem to have any effect at all.

The only effect seems to have renaming the agreements.phtml to _old, then they are gone completely.

What is the problem there? I just would like to move the agreements to the end of the page, before the order buttons.

But be very nice if anyone could give me some support on this.

Regards.

Yes, the line <?php echo $this->getChildHtml('agreements') ?> is placed exactly like so.

What i do not understand is, if i comment out this line within the info.phtml and within the checkout.xml at base path and path of "mytheme" the agreements are still displayed at top of review.phtml.

Only if i rename both agreements.phtml within base and "mytheme"-path to like "_old" they are gone.
But moving the line <?php echo $this->getChildHtml('agreements') ?> to place agreements at end of the page doesn´t work at all.

Do i have to do some configuration in the onepagecontroller.php-file to get this work?