texts: Magento2.2.2 Backend Curl CURLPROTO_HTTP undefined

texts:
This is an odd one: I've just updated my to macOS High Sierra installed missing extensions Frontend it's all good Backend Admin login fine But when logged in get Exepction:

> 1 exception(s):
Exception #0 (Exception): Notice: Use of undefined constant CURLPROTO_HTTP - assumed 'CURLPROTO_HTTP' in /Library/WebServer/Documents/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

It doesn't make sense curl details are bellow:

curl -V
curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy

php -i

...
curl

cURL support => enabled
cURL Information => 7.54.0
Age => 3
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => No
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin17.0
SSL Version => LibreSSL/2.0.20
ZLib Version => 1.2.11
...

Disabled warning give :

Fatal error: Uncaught Error: Call to undefined function Magento\Framework\HTTP\Adapter\curl_setopt() in /Library/WebServer/Documents/magento2/vendor/magento/framework/HTTP/Adapter/Curl.php:78

Line 78 is curl_setopt:

protected function _applyConfig()
    {
        // apply additional options to cURL
        foreach ($this->_options as $option => $value) {
            curl_setopt($this->_getResource(), $option, $value);
        }

        // apply config options
        foreach ($this->getDefaultConfig() as $option => $value) {
            curl_setopt($this->_getResource(), $option, $value);
        }

        return $this;
    }

I don't get it I have curl installed any one any ideas? Thanks.


texts: Shipping section of Invoice pdf gets blank after adding customer email

texts:
Based on this answer, to have the customer email address, I edited the $shippingAddress in app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php like below, but it makes the shipping section in pdf show nothing.
The customer is NOT LOGGED IN, does it matter? how to fix this?

$shippingAddress = $this->_formatAddress($order->getShippingAddress()->format('pdf')).'|'.Mage::helper('sales')->__('Email:').$order->getCustomerEmail();

I'm wondering if .'|'.Mage::helper('sales')->__('Email:').$order->getCustomerEmail(); is correct?


texts: Magento 2 - To show CMS pages in catalog result pages

texts:
How to show CMS pages in following format on catalog result pages.

On Catalog search result pages, i want to show second section in the form of CMS pages after product list or grid based on searched parameter query string.
I tried below codes.

<body>
    <referenceContainer name="content">
        <block class="CMS/Search/Block/Search" name="cmssearch.table" template="CMS_Search::search-cms.phtml"/>
    </referenceContainer>
</body>

<?php
namespace CMS\Search\Block;
use Magento\Framework\View\Element\Template;

 protected  _resource;

class Search extends Template
{
public function __construct(Context $context,
\Magento\Framework\App\ResourceConnection $resource)
  {
    $this->_resource = $resource;
    parent::__construct($context);

  }

    public function getResultsofCMSPages()
    {
        $query = 'asdf';
        $connection = $this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
        $tbl = $connection->getTableName('cms_page');
        $result = $connection->fetchAll('SELECT title,content,url FROM `'.$tbl.'` WHERE `is_active`=1' and `content` LIKE '%'.$query.'%' );
        return $result;
    }
}

Using couple of ref. as follows:
Magento 2 : How to Fetch CMS Page Content Using Search

At catalog search page, it should show as follows:


texts: How to reduce the blank center space between float:left & float:right in CSS?

texts:
Current Output

HTML

            £349.99

            £399.99

Now I need to reduce center blank space as follows


texts: Wondering why My CMS page will not display properly

texts:
I have designed a responsive Cms page Although, When I Add the Css to html inside  and save the page footer expands and 2 of the header buttons drop slightly Any solutions For an Example please see url. http://www.villalife.co.uk/abc

Any help would be greatly appreciated.


texts: Estimate Shipping and Tax in product view

texts:
I made the block checkout/cart/shipping.phtml visible in catalog/product/view.phtml.
I need this to estimate the shipping value in the product view.

The checkout/cart/shipping.phtml work very well in the /checkout/cart.phtml,
But it does not work in catalog/product/view.phtml.
Can anyone help me to make this work?

This is the site: http://oxiban.com.br


texts: Magento MultiStore Rewrite rules does not works

texts:
I have this code in .htaccess

RewriteCond %{HTTP_HOST} www\.fashionstudio\.ie [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:default]
RewriteCond %{HTTP_HOST} www\.fashionstudio\.ie [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:store]

RewriteCond %{HTTP_HOST} www\.cansshoes\.ie [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:cansshoes_en]
RewriteCond %{HTTP_HOST} www\.cansshoes\.ie [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:store]

Magento 1.9 configured as well..

On the shared hosting account I have cansshoes.ie pointed to fashionstudio.ie ( where the base installation is )
Have been reading dose of the help over here and other sources and all should be working just fine, but it's not... I don't even know where to look at any more..

If it's could be Hosting issue, then I need to tell them where to look at?

Please, please advice
Regards,
Kos


texts: Magento 2 REST API ship order tracks error

texts:
I can create a shipment for an order via REST API. But when i try to add tracks i get the error: Carrier Code can not be empty.

This is my code:
Array
(
    [items] => Array
        (
        )

[notify] => 1
[appendComment] => 1
[comment] => Array
    (
        [comment] => Sent via Parcelforce
        [is_visible_on_front] => 1
    )

[tracks] => Array
    (
        [extension_attributes] => Array
            (
            )

        [track_number] => P2G9999999
        [title] => Parcelforce
        [carrier_code] => custom
    )

)


texts:
I'm trying to use the local.xml file to change the default template for my entire theme. I found this question but it's not working for me: How do I set a Magento page's template to the 2-column layout?

I am able to add a custom css file to the head of the page, so it seems that my local.xml is located in the correct place. app/design/frontend/mypackage/default/layout/local.xml

Here is my local.xml:

<?xml version="1.0"?>
<layout>
  <default>
    <reference name="head">
      <action method="addCss"><stylesheet>css/this_style_sheet_is_working.css></stylesheet></action>
    </reference>

    <reference name="root">
      <action method="setTemplate">
        <template>page/custom.phtml</template>
      </action>
    </reference>
  </default>
</layout>

How can I change the default template? Why is my local.xml able to load css but not change the layout file?


texts:
I've an urgent issue that I don't know how to troubleshoot. I'd be grateful for some suggestions.

When I change the price for a particular product in the backend, it doesn't change on the frontend. I've done the usual reindex and clear cache - but no go.

edit:
I've cleaned this question up, removing a lot of additional issues which may have been a distraction. Further troublshooting of this issue gives the following updates:

refreshed caches, and restarted apache - no change
creating a new simple product in the backend, then changing that - does work!

I use MAGMI to make my updates to products, adding them, changing prices etc, so perhaps this is the problem. Somehow, the Magmi process has 'broken' the products somehow.

Does anyone have ideas on how I can troubleshoot that further, and somehow fix? The products look fine in the admin screen - they just can't be updated on the front end.

(If I make the update via Magmi, it works though)


texts: How to delete product images using magento csv import in magento 2?

texts:
Magento Version: 2.1.0

We have added the wrong image for some of the products when importing through Magento CSV import. we want to remove the images from those products and add new images or replace the images for the same.

We are trying to import using the normal Magento import functionality by selecting replace option. If we select to delete it will delete the complete product. Same issue we will get if we want to remove any multiselect option and add new for any particular product.

EX: if SKU is xyz456 - we added 3 images before and we want to remove these and add new 3 or 4 images or replace the images for the same SKU then it is not working. It will add new images also and it will keep old images also.

Same way if we have selected multiselect options for attribute lets say material: wood, iron and we want to change it to steel, copper then it is not allowing. It will add Material: wood, iron, steel, copper

Can anyone please explain how we can update these. Magento has not provided clear documentation on product import and export functionality.


texts: How to sort by popularity in magento 2 product list?

texts:
I want to sort products by popularity and discount(high to low).

How can I achieve?


texts: Error accessing Catalog > Manage Categories

texts:
When I am trying to access Catalog > Manage categories, I am having the below error:

Source model "defaultcatview/category_attribute_source_view" not found
for attribute "default_cat_list_view"


texts:
I have define new eav attribute(Test_decimal) with 'decimal' type. The Test_decimal can sort in PLP and SRP.
Added value to Test_decimal attribute for some products
Run php bin/magento indexer:reindex

But when I searched in the elasticsearch, I have found there are have more value is Infinity, the details as follow:

"sort": [
     "Infinity"
     ]

How to make the null or 0 stored 0, not infinity in elasticsearch

Thanks.


texts: Turpentine Varnish + {{form_key_esi_placeholder}} not replaced in URLs

texts:
I've configured Turpentine Varnish Cache and set all required settings . After then checking with Unsecured path () .

When I am going to press "Add to Cart" Button then cart bucket not updated with order product . As well when I debug it then "add to cart " button there is action link shows {{form_key_esi_placeholder}} . This placeholder is not replacing with actual keywords.

Other then When I checked with Secure Url then all things working fine.

How can I fix that. Any ideas?


texts:
Today I create newsite magento2  MAGETWO-40129: M2 GitHub Update (version 1.0.0-beta. When i install composer get

ZipArchive::extractTo(): Full extraction path exceed MAXPATHLEN (260)

how do fix it. Any thanks.


texts: Dropdown menu hidden behind Page content, Magento 2

texts:
Before some time everything was right i dont know when it happened. Dropdown menu is hidden behind page content. Recently i've only done reindexing. I've checked z-index there isn't issue. link to website and image is attached below. Kindly have a check soon as possible. Thanks

Link to Website


texts: Set default value to custom attribute for all products

texts:
I have created the custom attribute (test) for products as a text field with default value('test') from admin panel

And assigned that attribute to default attribute set.

Now I can able to see the new custom attribute in product edit page.

When I try to filter with the product collection

Mage::getModel('catalog/product')->getCollection()
       ->addAttributeToSelect('*')
       ->addAttributeToFilter('test', array('like' => 'test'))->getData();

It return the empty array.

My Question is :

Is there any way to set the default value to attributes through installer script?

Why the default value is not set to that attribute?

Is there is any way to add the default values for all products?. I have more than 10,000 products in my store.

Note :

I don't want load the whole product collection and set value for each product.


texts: AJAX call not updating page - Ajax pagination and layered navigation extension

texts:
I have just adopted Magento and have to say I am very impressed. However as I am a noob I am having a couple of issues, so I would appreciate some advice/help

I am trying to implement a module called ajax pagination and layered navigation onto our site however the ajax update seems to be failing somewhere.

http://thealpacacentre.co.uk/catalogsearch/result/?q=alpaca

We're having to force a browser refresh on the page after applying the layered navigation filters on the left for the page to be correctly rendered.

Can anyone help please?


texts:
I am trying to pass additional options from quote item to order item using following observer.

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

    <event name="checkout_cart_product_add_after">

        <observer name="checkout_cart_product_add_after_addtionaloptions" instance="<<CompanyName>>\Catalog\Observer\AdditionalOptions" />

    </event>

    <event name="sales_model_service_quote_submit_before">

        <observer name="copy_quote_additionaloptions_to_sales" instance="<<CompanyName>>\Catalog\Observer\CopyQuoteAdditionalOptionsToSales" />

    </event>

</config>

And following is the observer php code

<?php
namespace <<CompanyName>>\Catalog\Observer;

//use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class CopyQuoteAdditionalOptionsToSales implements ObserverInterface
{
    private $quoteItems = [];
    private $quote = null;
    private $order = null;

    protected $logger;

    public function __construct(\Psr\Log\LoggerInterface $logger){
        $this->logger = $logger;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $this->logger->debug("Inside sales execute method");
        $this->quote = $observer->getQuote();
        $this->order = $observer->getOrder();
        /* @var  \Magento\Sales\Model\Order\Item $orderItem */
        foreach($this->order->getItems() as $orderItem){
            if(!$orderItem->getParentItemId() && $orderItem->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE){
                if($quoteItem = $this->getQuoteItemById($orderItem->getQuoteItemId())){
                    if ($additionalOptionsQuote = $quoteItem->getOptionByCode('additional_options')) {
                        //To do
                        // - check to make sure element are not added twice
                        // - $additionalOptionsQuote - may not be an array
                        if($additionalOptionsOrder = $orderItem->getProductOptionByCode('additional_options')){
                            $additionalOptions = array_merge($additionalOptionsQuote, $additionalOptionsOrder);
                        }
                        else{
                            $additionalOptions = $additionalOptionsQuote;
                        }
                        if(count($additionalOptions) > 0){
                            $options = $orderItem->getProductOptions();
                            $options['additional_options'] = unserialize($additionalOptions->getValue());
                            $orderItem->setProductOptions($options);
                        }
                    }
                }
            }
        }
    }
    private function getQuoteItemById($id){
        if(empty($this->quoteItems)){
            /* @var  \Magento\Quote\Model\Quote\Item $item */
            foreach($this->quote->getItems() as $item){
                //filter out config/bundle etc product
                if(!$item->getParentItemId() && $item->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE){
                    $this->quoteItems[$item->getId()] = $item;
                }
            }
        }
        if(array_key_exists($id, $this->quoteItems)){
            return $this->quoteItems[$id];
        }
        return null;
    }
}

quote_item_option table has the data.
Now whenever I place an order, the above observer execute function doesn't
execute.


texts: Incomplete order available. In those cases, we fulfill a partial order and need to have that order reflect that

texts: Sometime don't have the complete order available. In those cases, we fulfill a  partial order and need to have that order reflect that. How do I handle that use case?


texts: Cannot edit Top Navigation menu (not listed in Categories section)

texts:
I have been asked to look after and do some work on this site:

http://tapesonline.co.nz/

It's mostly straightforward so far except:

I cannot find where to edit the top navigation menu.
The existing top menu pages are NOT listed in the 'Manage Categories' section of the           admin panel, so I'm not sure where to change them in the
navigation menu.
I need to edit the Contact content page but it is not listed in the pages section.

I have searched google to no avail.

Please steer me in the correct direction.

Any help appreciated!

Thank you!


texts: My pagination is not showing in my custom page

texts:
I have a custom page that contains a product list.
But it just show toolbar with wrong counts and no pagination like this picture

All of my products are showing there.

I've tried to add this scripts on my xml layout

1.

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

2. <block type="page/html_pager" name="product_list_toolbar_pager"/>

I've put this script too on my index.phtml:

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

Please help me.


texts:
I want to upgrade Magento 2.1.7 to Magento 2.3.2 and I follow below commands

sudo composer require magento/product-community-edition=2.3.2 --no-update
sudo composer require --dev phpunit/phpunit:~6.2.0 friendsofphp/php-cs-fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.2.2 --no-update
sudo composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update
sudo composer update

But sudo composer update command killed.

please see below image.

Please help me on how to upgrade from 2.1.7 to 2.3.2.


texts: How to load a Catalog Price Rule by name?

texts:
I currently load it by ID, like so:

Mage::getModel('catalogrule/rule')->load(1);


texts: How to manage images for different storeviews?

texts:
Magento2 with 1 website and 2 storeviews SV English and SV German

First thing : I upload 5 images in image uploading section of product-page with setting All Storeview mode. Let's call image A, B, C, D and E. I do the upload, one by one, so they appear in the right sequence A,B,C,D,E. I save and they then magically appear in a different sequence (let's say A,C,E,D,B). I can drag and drop them to the required sequence, save and all OK.

Now if  I go to my German SV to update the necessary data (not the images) and I realized that the sequence was here different from the default one.

Is that a known issue? Is there a solution so that the sequence is applied to all Storeviews?

I also mention that if I hide/unhide an image in the German SV, it has no effect on the All storeviews even though the image Gallery attribute is set as Global.


texts: url rewrite changing automatically, how to permanently fix this?

texts:
I have added links to my cms pages in menu bar(about-us, contact-us, gallery).

And created url rewrite(type=custom) with url rewrite management option in magento admin panel.

Its works fine.
But after some time url rewrite changes the type to system and Target Path Url rewrite upgrade themselves automatically.

like

type = system
Target Path = catalog/category/view/id/158

And give messages like product not found in this category.

I am creating url rewrite using url rewrite management daily 2-3 times and deleting those automatically created.

I am searching for a permanent solution

Please help me


texts: How add a country selector in the header section?

texts:
I need add a country selector in the header section, next to the currency selector. How is the right way to do this?

Edit:

I realized that there was not much information in my question, so it was misunderstood.  I apologize and give more information now:

I am developing a plugin for Magento 1.9 that needs to modify some information in the shop depending on the country of the customer.  So I need to display an additional country selection box in the page header, that does not change the store view but only delivers the selection to my plugin.  Also I will initialize the country through GeoIP.

The problem is that I am still not able to find a way to insert something in the top line of the page, next to the language and currency selectors. And of course this must work for any theme the final shop might install.

I have read something about blocks in Magento, but I am not sure which block to choose and how this would work without having to create a theme of my own.  I cannot deliver the plugin with a separate theme, obviously. And do I have to overwrite this block completely or can I append to it?

My layout XML file (frontend/base/default/layout/pluginname) looks like this:

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="header">
            <reference name="top.container">
                <block type="page/switch" name="my_country_switcher" template="myplugin/controlcountry.phtml"/>
            </reference>
        </reference>
    </default>
</layout>

This displays the selection box on the Home page below the category menu:

but what do I need to change to make it show here:

Any pointers in the right direction are welcome.


texts: CAPTCHA is not shown at Login/register form

texts:
I followed below steps to show captcha in login and registration form. But I can't see it.

Login to backend
Go to system > configuration > customers > customer configuration > CAPTCHA and select your website scope
Enable CAPTCHA on frontend - Yes
Select all forms into "Form" box
In "Displaying Mode" box select "After number of attempts to login"
Number of Unsuccessful Attempts to Login = 0
Save Config
Go to frontend and press "Log in" link

Is there any thing else left to enable captcha in login or registration form...


texts: How to display category image in home page with custom css?

texts:
I want to display all of my category image with in home page. What should i do for this?
I am using CE:1.9.2.4


texts: How to override Mage_Shipping_Model_Carrier_Flatrate?

texts:
I need to override Mage_Shipping_Model_Carrier_Flatrate through my custom module in magento 1.7.

Right now i have done this :

In my app/etc/modules/ i have the file "Namespace_Modulename.xml" with the code:

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

In my app/code/local/Namespace/Modulename/etc/ i have file "config.xml" with the code:

 <?xml version="1.0" encoding="utf-8"?>
  <config>
    <modules>
       <Namespace_Modulename>
           <version>0.1.0</version>
       </Namespace_Modulename>
    </modules>
    <global>
     <models>
       <shipping>
         <rewrite>
              <carrier_flatrate>Namespace_Modulename_Model_Flatrate</carrier_flatrate>
         </rewrite>
       </shipping>
     </models>
   </global>
 </config>

In my app/code/local/Namespace/Modulename/Model i have file "Flatrate.php" with the code:

  class Namespace_Modulename_Model_Flatrate
   extends Mage_Shipping_Model_Carrier_Abstract
   implements Mage_Shipping_Model_Carrier_Interface
   {

   protected $_code = 'flatrate';

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
    if (!$this->getConfigFlag('active')) {
        return false;
    }

    $freeBoxes = 0;
    if ($request->getAllItems()) {
        foreach ($request->getAllItems() as $item) {
            if ($item->getFreeShipping() && !$item->getProduct()->getTypeInstance()->isVirtual()) {
                $freeBoxes+=$item->getQty();
            }
        }
    }
    $this->setFreeBoxes($freeBoxes);

    $result = Mage::getModel('shipping/rate_result');
    if ($this->getConfigData('type') == 'O') { // per order
        $shippingPrice = $this->getConfigData('price');
    } elseif ($this->getConfigData('type') == 'I') { // per item
        $shippingPrice = '0.00';
        foreach ($request->getAllItems() as $item) {
            if (!$item->getFreeShipping()) {
                $productId = $item->getProduct()->getId();
                $productList = Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToSelect('ship_price')
                    ->addIdFilter($productId);
                foreach($productList as $product) {
                    $quantity = $item->getQty();
                    if ($product->getShipPrice()) {
                        $shippingPrice+=$product->getShipPrice() * $quantity;
                    } else {
                        $shippingPrice+=$this->getConfigData('price') * $quantity;

                    }
                }
            }

        }
    } else {
        $shippingPrice = false;
    }

    $shippingPrice = $this->getFinalPriceWithHandlingFee($shippingPrice);

    if ($shippingPrice !== false) {
        $method = Mage::getModel('shipping/rate_result_method');

        $method->setCarrier('flatrate');
        $method->setCarrierTitle($this->getConfigData('title'));

        $method->setMethod('flatrate');
        $method->setMethodTitle($this->getConfigData('name'));

        if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
            $shippingPrice = '0.00';
        }

        $method->setPrice($shippingPrice);
        $method->setCost($shippingPrice);

        $result->append($method);
    }

    return $result;
}

public function getAllowedMethods()
{
    return array('flatrate'=>$this->getConfigData('name'));
}

}

But it's not working. May be i am missing something or doing anything wrong.
Please help,

Thanks in advance,
Sarvagya


texts: Root Category and Sub Categories are not showing in the Admin Panel

texts:
I recently installed Magento Community 1.7 and a template on my site.
The menu appears fine on the site, but in the Admin panel, I don't see any Root Category or Sub Categories.
I've tried reindexing the data but still no luck?
It looks just like this picture:


texts: How can I reset or reinitialize the shipping method on cart change?

texts:
Is there a way to reinitialise the shipping method. Sometimes customers wants to back and add a product to the shopping cart, after they have already chosen a shipping method. I would like to remove the already selected shipping methode.

I'm using the following shipping methodes:

<input name="shipping_method" type="radio" value="freeshipping_freeshipping" id="s_method_freeshipping_freeshipping" class=" radio">

<input name="shipping_method" type="radio" value="tablerate_bestway" id="s_method_tablerate_bestway" class="radio">

Other usefull info:

save: function(){
    if (checkout.loadWaiting!=false) return;
    var validator = new Validation(this.form);
    if (validator.validate()) {
        checkout.setLoadWaiting('shipping');
        var request = new Ajax.Request(
            this.saveUrl,
            {
                method:'post',
                onComplete: this.onComplete,
                onSuccess: this.onSave,
                onFailure: checkout.ajaxFailure.bind(checkout),
                parameters: Form.serialize(this.form)
            }
        );
    }
},

resetLoadWaiting: function(transport){
    checkout.setLoadWaiting(false);
},
nextStep: function(transport){
    if (transport && transport.responseText){
        try{
            response = eval('(' + transport.responseText + ')');
        }
        catch (e) {
            response = {};
        }
    }
    if (response.error){
        if ((typeof response.message) == 'string') {
            alert(response.message);
        } else {
            if (window.shippingRegionUpdater) {
                shippingRegionUpdater.update();
            }
            alert(response.message.join("\n"));
        }

        return false;
    }

    checkout.setStepResponse(response);

    /*
     var updater = new Ajax.Updater(
     'checkout-shipping-method-load',
     this.methodsUrl,
     {method:'get', onSuccess: checkout.setShipping.bind(checkout)}
     );
     */
    //checkout.setShipping();
}
}

// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype = {
    initialize: function(form, saveUrl){
        this.form = form;
        if ($(this.form)) {
            $(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
        }
        this.saveUrl = saveUrl;
        this.validator = new Validation(this.form);
        this.onSave = this.nextStep.bindAsEventListener(this);
        this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
    },

    validate: function() {
        var methods = document.getElementsByName('shipping_method');
        if (methods.length==0) {
            alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
            return false;
        }

        if(!this.validator.validate()) {
            return false;
        }

        for (var i=0; i<methods.length; i++) {
            if (methods[i].checked) {
                return true;
            }
        }
        alert(Translator.translate('Please specify shipping method.').stripTags());
        return false;
    },

Can you also provide the file that I need to modify? I'm quit new to magento and not sure of what I need to modify. I did some research and found YourModule/etc/config.xml in the section  and YourModule/Model/Observer.php.


texts: 1.9.1.0 not sending emails, no errors, cron runs. manual emails do sent

texts:
There has been some write-up on StackExchange yet. but i cannot seem to fix it. My magento transactional e-mail are not sending. While when i manually press "sent email" in the back-end it sends my emails without any problem.

Here some specific information about this installation

Running Magento 1.9.1.0
Running Mandrill Ebizmarts plugin
Running Aoe_Scheduler and heartbeat is running
Checked Exception.log no errors
Checked System.log no errors
Checked Mandrill.log and the manual emails are logged. further no errors.
I have not disabled email communications in config.
All settings double checked.

Really have no clue anymore.

Edit

Ok what i have noticed, the cron stays empty when creating orders. still all logs dont show any errors. while if there are any errors it will show them.
So the CronJob stays empty!


texts: How to add a Customer Attribute field to the registration form from code

texts:
I'm creating an extension, which defines some customer attributes. I added these attributes to the adminhtml, so the admin can set these attributes, but I cannot find a way to add this field to the customer's registration (to the frontend) from code.

Since this is an extension I need to add this from code and not with cloning/overriding a template file to be compatible with other extensions.

Can You please let me know, what is the best way to do this?

Thanks in advance for Your answers!


texts: Add ajax qty plus minus buttons in shop page

texts: Hello guys i want to add qty plus and minus in catalog view so when my clients press plus automatically add the item to cart and if the press minus remove the item specific qty from cart. and if they manually remove item from cart or add different quantity in cart also update catalog view


texts: Use "ifconfig" to conditionally add CSS assets

texts:
Is there any way to use ifconfig in Magento 2 to conditionally add CSS assets, similar to Magento 1? Here's an example from Magento 1:

<action ifconfig="config_path/group/field" method="addItem">
    <type>skin_css</type><name>css/styles.css</name>
</action>

I tried something like this in Magento 2 but it doesn't work:

<head>
    <css src="css/styles.css"
        ifconfig="config_path/group/field" />
</head>

It just displays the ifconfig attribute on frontend:

<link rel="stylesheet" type="text/css"
    ifconfig="config_path/group/field"
    href="http://example.com/pub/static/frontend/Magento/luma/en_US/css/styles.css" />

Is there any equivalent in Magento 2?


texts: Change Header TEXT Links for IMAGE LINKS (for 'My Account', 'My Wishlist', 'My Cart', 'Log In', Log Out')

texts:
I am using Magento 1.8.1, and I couldn't find any solution to replace the text links 'My Account', 'My Wishlist', 'My Cart', 'Log In', Log Out' for icons/image links for my Mobile responsive version.

When I inspect my page hint path I have these files that appears:
- header.phtml file [/app/design/frontend/default/[Theme]/template/page/html] in which I have the following code that I cannot replace text link by images since my Text links are not directly explicitly mentioned here (so I cannot call a class in my css):

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

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

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

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

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

From links.phtml [/app/design/frontend/default/[Theme]/template/page/template] I have the following code that also appear when I do a code inspection:

<?php $_links = $this->getLinks(); ?>
<?php if(count($_links)>0): ?>
<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
<?php foreach($_links as $_link): ?>
    <?php if ($_link instanceof Mage_Core_Block_Abstract):?>
        <?php echo $_link->toHtml() ?>
    <?php else: ?>
        <li
        <?php if($_link->getIsFirst()||$_link->getIsLast()): ?>
            class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?><?php if($_link->getIsLast()): ?>last<?php endif; ?>"
        <?php endif; ?>
        <?php echo $_link->getLiParams() ?>>
        <?php echo $_link->getBeforeText() ?><a href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?><?php echo $_link->getAfterText() ?>

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

Which is impossible to retrieve the relevant class to call it on my css file in order for me to put an image. Note I believe text links are called with the following code:

.links { text-align: right; }
.links li { display:inline; padding: 1px 10px 1px 5px; background: url(../images/toplinksap.png) no-repeat center right; }
.links li.first { padding-left:0 !important; }
.links li.last { background:none !important; padding-right:0 !important; }

In which xml file such as customer.xml [app/design/frontend/default/blanco/layout] gives the position of the links for example for 'My Account' I have the following code:

<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>

So my questions are how can I replace the label "My Account" by an image? (code if not relevant which file should I modify with which code + images path for uploading purpose are appreciated).


texts: Magento 2: Override contact us email template using extension

texts:
I followed below answer but could not override default contact us email template.

Magento 2: How to change Contact Us Email Type?

I developed extension to override form.phtml to add new contact us fields. Now I want to add those custom fields in contact us email template. I tried as per above solution but it always use default contact us email template.


texts:
i'm using 2.2.X

How to get Stores > Attributes > Product > attributes code custom show to the Front-end and CMS Page.

look like <? php echo:_('xxxx') ?> 18n

THANK YOU!


texts: Not saved tax vat field entered in checkout page in magento

texts:
Customer Address in Admin Page:

In my checkout page,

Filled  the fields and I placed the order,

After placed an order I checked in my backend,all the fields are saved correctly except taxvat field.


texts: Magento 2.2.2 Admin Form Multiselect Box Issue

texts: My Admin Ui Component Form was working fine , but all of a sudden , the Multiselect box went out of proportion from the rest of the field . Does anybody faced the same issue or anyone know how to fix it!


texts: Magento 2 - Get URL data by request path

texts:
I have gathered URLs from sitemap.xml now I need category ID against category URL and Product ID against product URL. I want to do it by getting URL data from  url_rewrite table

In Magento 1.9 we use this code to get data by request path

Mage::getModel('core/url_rewrite')->loadByRequestPath("abcPath");

How can we do it in Magento 2?


texts: Magento 2 Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Session\SaveHandler\Native::write()

texts:
I've been getting this error when I tried to access my project:

  Fatal error: Uncaught Error: Call to undefined method
  Magento\Framework\Session\SaveHandler\Native::write() in
  C:\xampp\htdocs\project\vendor\magento\framework\Session\SaveHandler.php:92
  Stack trace: #0 [internal function]:
  Magento\Framework\Session\SaveHandler->write('ov6f1tnc2jcmrrv...',
  '_session_valida...') #1
  C:\xampp\htdocs\project\vendor\magento\module-page-cache\Model\Layout\DepersonalizePlugin.php(56):
  session_write_close() #2
  C:\xampp\htdocs\project\vendor\magento\framework\Interception\Interceptor.php(146):
  Magento\PageCache\Model\Layout\DepersonalizePlugin->afterGenerateXml(Object(Magento\Framework\View\Layout\Interceptor),
  Object(Magento\Framework\View\Layout\Interceptor)) #3
  C:\xampp\htdocs\project\vendor\magento\framework\Interception\Interceptor.php(153):
  Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception{closure}()
   #4 C:\xampp\htdocs\project\generated\code\Magento\Framework\View\Layout\Interceptor.php(78):
  Magento\Framework\View\Layout\Interceptor->___callPlugins('ge in
  C:\xampp\htdocs\project\vendor\magento\framework\Session\SaveHandler.php
  on line 92

This happened after I refreshed the browser


texts:
I have a custom module(now just overriding the template files to customize the default checkout structure) that overrides the default checkout process. I want to change the default order of checkout process to Order Review,Sign In,Shipping,Payment.

I have tried by editing opcheckout.js file. But I can't see any change in its order.
How is it possible to change its order? Please help..

I have tried to override the block file:app/code/core/Mage/Checkout/Block/Onepage/Abstract.php to app/code/local/Company/Custcheckout/Block/Onepage/Abstract.php

<config>
    <modules>
        <Company_Custcheckout>
            <version>0.0.1</version>
        </Company_Custcheckout>
    </modules>
    <global>
        <blocks>
            <checkout>
                <rewrite>
                    <onepage_abstract>Company_Custcheckout_Block_Onepage_Abstract</onepage_abstract>

                </rewrite>
            </checkout>
        </blocks>
    </global>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                        <Company_Custcheckout before="Mage_Checkout">Company_Custcheckout</Company_Custcheckout>
                    </modules>
                </args>
            </checkout>
        </routers>
        <layout>
            <updates>
                <Custcheckout>
                    <file>custcheckout/custcheckout.xml</file>
                </Custcheckout>
            </updates>
        </layout>
    </frontend>
</config>

I have changed opcheckout.js file (line number:40) as

this.steps = ['login', 'review', 'shipping', 'shipping_method', 'billing', 'payment'];


texts:
I am new on Magento community and a beginner in coding. I need some help because when I try to go to my website admin or my website, there is an message error :Error log record number.

The message error is like this
Exception printing is disabled by default for security reasons.

Error log record number: 409859914196

It happens just after I tried to clear the store cache

Can anyone help me on this one please


texts: How to display product image slider's arrow if image count is greater than 4?

texts:
I want to display arrow if image count is greater than 4.

In view.xml

<var name="navarrows">false</var>

I changed from true to false. Now arrow is not displayed but I want arrow if image is greater than 4


texts:
I am having issues with getting fotorama responsive, the breakpoint for a resize is not being actioned. Below is my process of getting this to work:

I changed my themes breakpoint for screen_m via the following method, which worked fine:
app/design/frontend/[Vendor]/[Theme]/web/css/source/_variables_extend.less

@screen__m: 991px;

The issue I am now faced with is fotorama gallery. I have actioned the following
app/design/frontend/[Vendor]/[Theme]/etc/view.xml

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
...
    <vars module="Magento_Catalog">
        <var name="breakpoints">
            <var name="mobile">
                <var name="conditions">
                    <var name="max-width">991px</var>
                </var>
            </var>
        </var>
    </vars>
...
</view>

This should then used in the following file:
Magento_Catalog::/product/view/gallery.phtml


texts:
I try to create a module in the administration of my site.I have a mistake I can not seem to solve for many hours:

Recoverable Error: Argument 1 passed to Mage_Adminhtml_Controller_Action::_addContent() must be an instance of Mage_Core_Block_Abstract, boolean given,

here my config file :

<config>
    <modules>
        <Digitgold_Demande>
            <version>0.1.0</version>
        </Digitgold_Demande>
    </modules>

       <global>
        <helpers>
            <listedemande>
                <!-- Helper definition needed by Magento -->
                <class>Digitgold_ListeDemande_Helper</class>
            </listedemande>
        </helpers>

        <blocks>
            <listedemande>
                <class>DigitGold_ListeDemande_Block</class>
            </listedemande>
        </blocks>

    </global>

    <admin>
         <routers>
             <test>
                <use>admin</use>
                <args>
                   <module>Digitgold_ListeDemande</module>
                   <frontName>adminlisteclient</frontName>
                </args>
             </test>
          </routers>
     </admin>
     <adminhtml>
       <menu>
          <customer>
              <children>
                  <listedemande translate="title" module="listedemande">
                     <title>Demande client</title>
                     <sort_order>100</sort_order>
                     <action>adminlisteclient/liste/index</action>
                   </listedemande>
            </children>
          </customer>
        </menu>
    </adminhtml>

</config>

here my controller :

    class DigitGold_ListeDemande_ListeController extends Mage_Adminhtml_Controller_Action
{

        protected function _initAction()
    {
        $this->loadLayout();
        ->_setActiveMenu('customer/listedemande');
        return $this;
    }

        public function gridAction()
    {
        $this->loadLayout();
        $this->getResponse()->setBody(
            $this->getLayout()->createBlock('listedemande/Adminhtml_Liste_grid')->toHtml()
        );
    }

    public function indexAction()
    {
        $this->_title($this->__('Sales'))->_title($this->__('listedemande'));

        $this->_initAction()
            ->_addContent($this->getLayout()->createBlock('listedemande/adminhtml_listdemande'))
            ->renderLayout();
    }


texts:
Anyone using CasperJS for functional testing in Magento? By functional testing I mean testing the frontend/backend for various usage scenarios like checkout, register a new account, creating a credit memo and so on.

What are your use cases?

Update:

Let's hope that after Testing Magento presentation, more developers will start using CasperJS


texts: Get all options for configurable product Magento 2.0 REST Api

texts:
When i call this API,

{{base_url}}index.php/rest/V1/configurable-products/:sku/options/all

I am getting  a response like this,

[
  {
    "id": 9,
    "attribute_id": "93",
    "label": "Color",
    "position": 0,
    "values": [
      {
        "value_index": 15
      },
      {
        "value_index": 16
      },
      {
        "value_index": 17
      }
    ],
    "product_id": 19
  },
  {
    "id": 10,
    "attribute_id": "176",
    "label": "side",
    "position": 1,
    "values": [
      {
        "value_index": 18
      },
      {
        "value_index": 19
      }
    ],
    "product_id": 19
  }
]

But i want label for all these value_indexes.Could i get all these values in  a single request


texts: SFC CIM module fail to load system->Config after re-deployment

texts: I have a client who we moved from one host to the next host. The migration went fine except for the SFCSaved and SFCCore modules. I can not load system->config with the modules turned on. All I get is a white screen. I do not get any errors. I have removed all core_config_data items as well. Any thoughts?


texts: How to call static block into a phtml file Magento 2

texts:
I have static block in backend named as "varmo_custom_block_for_header".

I want to echo that block content into a header.phtml file.

I trying this way but not succeed :

 <?php echo $block->getLayout()->createBlock('magento\Cms\Block\Block')->setBlockId('varmo_custom_block_for_header')>toHtml();?>

But getting error as :

  Fatal error: Call to undefined function toHtml() in
  /opt/lampp/htdocs/xyz/app/design/frontend/xyzthemes/mo/xyzthemes_mo/templates/html/header.phtml
  on line 47


texts: i want to get the record of my subscriber filter by date from database which query should i write


texts:
I try to add a class to top links and in custom theme, I print it out.

<customer_logged_out>
    <reference name="top.links">
        <action method="addLink" translate="label title">
            <label>Create account</label>
            <url>customer/account/create</url>
            <!-- can use full url also -->
            <title>Create account</title>
            <prepare>true</prepare>
            <!-- set true if adding base url param -->
            <urlParams/>
            <liParams>class="li-create-account"</liParams>
            <aParams>class="a-create-account"</aParams>
            <position>90</position>
        </action>
    </reference>
</customer_logged_out>

I print it like that

<?php echo $_link->getLiParams(); ?>
<?php echo $_link->getAParams(); ?>

But the thing is, $_link->getLiParams() shows a-create-account instead of li-create-account. And $_link->getAParams() shows 90.

Does anybody know what I did wrong here? any help is very appreciated. Thanks.


texts: magento 2.1 getParentCategories for category id

texts:
i try to get getParentCategories for category id

 // 4 is product id
$product = $this->_productFactory->load(4);
$cats = $product->getCategoryIds();
$category = $this->categoryFactory->create();
         $collection = $category->getResourceCollection();
         $collection->addAttributeToSelect('*')
                    ->addAttributeToFilter('entity_id', $cats)
                    ->addIsActiveFilter()
                    ->load();
//\Magento\Catalog\Model\ResourceModel\Category = $this->category
foreach ($collection as $cat) {
              $data = $this->category->getParentCategories($cat->getId());
              echo "<pre/>"; print_r($data); exit;
              //$cat->getId();
          } exit;

This code is working in 2.0.7 but not working in 2.1


texts: On Paypal website, I don't want to show SKU information

texts:
When a customer process order with paypal, on paypal checkout page, all products SKU info are showing

How can I make the SKU info does not show on paypal site?


texts: I try to upload an image to my product at my fresh magento installation, but I can't find any way how to do this.


texts: How to handle partial order cancellation in Magento?

texts: We are currently building an e-commerce website in Magento community edition (Version 1.9) and we specifically want "partial order cancellation" option, so it allows the customer to cancel the particular product from the order instead of canceling the entire order. We are also wondering if we can have this function in the front end (website) to explicitly allow the user to cancel particular product from the order instead of canceling the complete order. It would be really helpful if you could provide us with available extensions for this feature.


texts: adding sub menu in customer account dashboard navigation

texts:
Is it Possible to add a sub menu in customer account dashboard?
Example:

ACCOUNT DASHBOARD
ACCOUNT INFORMATION
...
...
...
CUSTOM LINK
    -sub menu 1
    -sub menu 2
    -sub menu 3

Could anybody help me on this?

navigation.phtml

        <?php $_links = $this->getLinks(); ?>
        <?php $_index = 1; ?>
        <?php $_count = count($_links); ?>
        <?php foreach ($_links as $_link): ?>
            <?php $_last = ($_index++ >= $_count); ?>
            <?php if ($this->isActive($_link)): ?>
                <li class="current<?php echo ($_last ? ' last' : '') ?>"><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

aaaa

            <?php else: ?>
                <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

aaaa

                <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

aaaa

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


texts: Magento2 - How to change cart totals label?

texts:
I want to modify this label

Its from "checkout.cart.totals" block in magento\vendor\magento\module-checkout\view\frontend\layout\checkout_cart_index.xml
, and I'm pretty sure its this chunk of code that handles the label

<item name="grand-total" xsi:type="array">
    <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
    <item name="config" xsi:type="array">
        <item name="title" xsi:type="string" translate="true">Order Total</item>
        <item name="template" xsi:type="string">Magento_Checkout/cart/totals/grand-total</item>
    </item>
</item>

so I changed that chunk of code like so:

<item name="grand-total" xsi:type="array">
    <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
    <item name="config" xsi:type="array">
        <item name="title" xsi:type="string" translate="true">Grand Total</item>
        <item name="template" xsi:type="string">Magento_Checkout/cart/totals/grand-total</item>
    </item>
</item>

I just changed the title from Order Total to Grand Total.
But nothing changed. Front end still shows Order Total. Did I missed something?


texts: Magento 2 - assign custom email template to specific payment method

texts:
What is the proper way to assign custom email template to specific payment method upon creating an order? For example:

When choosing a Bank transfer payment method on the checkout it should send custom email template upon submiting the order, not the default order email.

I've looked around but found no proper solution for this issue, only this: Magento 2: how to declare a custom email template for your module


texts: How to add Enable/Disable extention functionality in admin side in custom extention magento 2.3

texts:
We want to create one custom extension which has functionality in admin side for Enable/Disable.
Any one help me how to add this functionality in my custom extension.


texts: Magento 2 - Require Js not a function error

texts:
Firstly, yes I'm in developer mode - and yes i've got the caché turned off and flushing it ( i've also deleted pub/static a fair few times ).

My issue:

I have an extension which adds a page to the admin area of the site on this page Im using require js to call in plugins to do things. Here is my requirejs file:

var config = {
  map: {
    '*': {
        nestable:  'Vender_Default/js/jquery.nestable.min'
    }
  }
};

Which is inside of the following file:

  vender/default/view/adminhtml/web/requirejs-config.js

and then in the page I'm doing the following:

require([
        'jquery',
        'nestable'
    ], function($, nestable) {
        $('#nestable').nestable({
                    group: 1,
                    maxDepth: 15
                }).on('change', updateOutput);
        });

Which i thought was correct, however i get the following errors:

  Cannot read property 'fn' of undefined at jquery.nestable.min.js:1

and

  TypeError: $(...).nestable is not a function

Which clearly its not now, because of the first error. Does anyone have any idea why I am getting this issue? I can't seem to get my head around why its not working. And most other questions on here don't seem to be the same issue.

** Have changed jQuery to $ and still receiving the error.

Thanks


texts: How to can i change page column layout for search result page when result not available?

texts:
I want to make 1 column layout for search result page when result not available.

How can i achieve this?


texts:
I'm using Magento 1.9.1.

I have really strange problem which i noticed not far ago.
When i installed this module: http://www.magentocommerce.com/magento-connect/bankpayment.html and i've set it active from the admin panel i've noticed that the payment method is not showing up.

Then i've set active and few other default payment methods that come with the magento installation and none of them showed as active.

It's important to say that i've deactivated the cache and cleared it.
Compilation mode is disabled.

Also i've tried to create some custom payment module which files i've deleted later on before i installed the BankPayment module.(I know that there is an Bank Transfer payment module already installed with magento, but i want to install this one)

Can you give me any advices, what should i check or where can be the problem and eventually how to fix it?


texts: Admingrid: Ui-component form in magento 2

texts:
I have created admin form using ui-component in backend, I have two fieldsets one(general) is containing noraml text fields another one(upload) is containing image uploder fields(small,large,extra large and medium images).It was working good for new action, But While clicking edit It fetches only the text field values from DB which is inside in general fieldset, but failed to fetch images which is inside in upload fieldset How do I overcome it .
Save.php

 $id = $this->getRequest()->getParam('id');
        try {
            $modelData = $this->model->create();
            //If gets id loads the model
            if ($id) {
                $modelData = $modelData->load($id);
            }

            $formData = $this->getRequest()->getParam('general');
            $imageData = $this->getRequest()->getParam('upload');

            $user = $this->getCurrentUser();

            if (empty($formData ['id'])) {

                $formData['id'] = null;
                // update the current user name for both created and updated
                $formData['created_by'] = $user;
                $formData['updated_by'] = $user;
            }

            $formData['updated_by'] = $user;
//For small image
            if (isset($imageData['small_image'])) {

                $formData['small_image'] = $imageData['small_image'][0]['name'];
            } else {
                $formData['small_image'] = null;
            }
//For medium image
            if (isset($imageData['medium_image'])) {
                $formData['medium_image'] = $imageData['medium_image'][0]['name'];
            } else {
                $formData['medium_image'] = null;
            }
            //For large Image
            if (isset($imageData['large_image'])) {
                $formData['large_image'] = $imageData['large_image'][0]['name'];
            } else {
                $formData['large_image'] = null;
            }
            // For Extra large image
            if (isset($imageData['extra_large_image'])) {
                $formData['extra_large_image'] = $imageData['extra_large_image'][0]['name'];
            } else {
                $formData['extra_large_image'] = null;
            }

           //Set all the data in DB from form
            $modelData->setData($formData);
            $modelData->save();

DataProvider.php

public function getData()
    {
        if (isset($this->_loadedData)) {
            return $this->_loadedData;
        }
        //Get the collection.
        $items = $this->collection->getItems();
        $slide = array();
        foreach ($items as $item) {
            $this->_loadedData[$item->getId()]['general'] = $item->getData();

            if ($item->getSmallImage()) {
                //Get the image and image url.
                $slide['small_image'][0]['name'] = $item->getSmallImage();
                $slide['small_image'][0]['url'] = $this->getMediaUrl() . 'path' . $item->getImage();

                $fullData = $this->_loadedData;
                $this->_loadedData[$item->getId()]['general'] = array_merge($fullData[$item->getId()]['general'], $slide);
            }
        }
        return $this->_loadedData;
    }

    public function getMediaUrl()
    {
        //Get the url for the image.
        $mediaUrl = $this->_storeManager->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
        return $mediaUrl;
    }

I have done this by reffering below url
Magento 2: Implement UI Fileuploader


texts: Is there a list of default magento attributes?

texts:
I am scrubbing a product spreadsheet csv.  I would like to know if these are custom, configured, or default. By configured I mean if something like customer groups were created and price tiers were set.

I have these attributes.

_tier_price_website
_tier_price_customer_group
_tier_price_qty
_tier_price_price
_group_price_website
_group_price_customer_group
_group_price_price


texts: Checkboxset element in form - not posting values of Field

texts:
I have begun creating a custom form for magento, this form include the elemenet checkboxset as documented here... https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-checkboxset.html
My form also includes other Fields.
In my controller I get the value of the fields using $this->getRequest()->getParams(), this works fine untill I introduce the checkboxset, now I am only able to retrieve the values of the checkboxes and no longer the values of all other fields.
It seems I can only have Fields or Checkboxset and not both together, doesn anyone have any idea what I may be doing wrong? I have pasted the code for my field-set below.
<fieldset name="invoice_details">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="collapsible" xsi:type="boolean">false</item>
            <item name="label" xsi:type="string" translate="true">Supplier Payment</item>
            <item name="sortOrder" xsi:type="number">10</item>
        </item>
    </argument>

    <checkboxset name="checkboxset_example">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="additionalInfo" xsi:type="string">Additional information</item>
            </item>
        </argument>
        <settings>
            <label translate="true">Checkboxset Component Example</label>
            <options>
                <option name="0" xsi:type="array">
                    <item name="value" xsi:type="number">1</item>
                    <item name="label" xsi:type="string" translate="true">Option #1</item>
                </option>
                <option name="1" xsi:type="array">
                    <item name="value" xsi:type="number">2</item>
                    <item name="label" xsi:type="string" translate="true">Option #2</item>
                </option>
                <option name="2" xsi:type="array">
                    <item name="value" xsi:type="number">3</item>
                    <item name="label" xsi:type="string" translate="true">Option #3</item>
                </option>
            </options>
        </settings>
    </checkboxset>

    <field name="bank_reference">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Bank Reference</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">bank_reference</item>
                <item name="dataScope" xsi:type="string">bank_reference</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                    <item name="alpha-num" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

</fieldset>

Thanks,
Dan.


texts: Multilingual site. Separate domains. hreflang issues

texts:
I'm trying to set up a multi-lingual site for a client but having some issues with conflicting ideas.

It's a UK based client selling to the UK and Europe. They'd like to serve different prices for UK customers and International customers. Therefore I've chosen to separate the two sites as two different 'websites' in Magento (as price scope is at website level).

We will use different domains to serve the two websites:

example.co.uk (for UK customers) (will have only English language)

example.com (for International customers) (will have English and other languages as store views)

The plan was to use hreflang tags to make Google aware of the separation and to avoid duplicate content across the two domains.

The problem is that both the English version of example.co.uk and the English version of example.com would both have to use the same English hreflang tag, causing a potential duplicate content issue once again.

And this is where I'm stuck. Any ideas?

Thanks!


texts: Custom module send email with custom language

texts:
I made a custom module that send an email to my customers.

app/code/Local/CustomEmail/registration.php

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

app/code/Local/CustomEmail/etc/module.xml

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

app/code/Local/CustomEmail/etc/email_templates.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="myemail_email_template" label="My Label" file="custom_email.html" type="html" module="Local_CustomEmail" area="frontend"/>
</config>

app/code/Local/CustomEmail/view/frontend/email/custom_email.html

{{template config_path="design/email/header_template"}}

{{trans "Text to translate"}}

{{template config_path="design/email/footer_template"}}

These emails should be sent by an external script not registered in Magento, so I have to use objectManager.

My website have 2 store views: (Italian (ID:1), English (ID:2))

myCustomScript.php

<?php
use Magento\Framework\App\Bootstrap;
require('../app/bootstrap.php');
use Magento\Catalog\Api\ProductRepositoryInterface;
Bootstrap::create(BP, $_SERVER)->getObjectManager();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$appState = $objectManager->get("Magento\Framework\App\State");
$appState->setAreaCode("frontend");
$transportBuilder = $objectManager->get("Magento\Framework\Mail\Template\TransportBuilder");

// I have the receiver email address and I know his language.
$userMail = 'a@a.com';
$userLang = 1; // 1=Italian; 2=English

$emailTemplateVariables = array();
$emailTemplateVariables['foo'] = 'bar';

$sender = [ 'name' => 'Sender Name', 'email' => 'sender@email.com'];

$postObject = new \Magento\Framework\DataObject();
$postObject->setData($emailTempVariables);

$transport = $transportBuilder->setTemplateIdentifier('myemail_email_template')
            ->setTemplateOptions(['area' => 'fontend', 'store' => $userLang]) // here I tried with 1 and 2 (the IDs of my store views in magento)
            ->setTemplateVars(['data' => $postObject])
            ->setFrom($sender)
            ->addTo($userEmail)
            ->getTransport();
$transport->sendMessage();

The email was sent but the receiver receive this email always in english.

The header and footer template are included in all the default transactional emails and the translation work fine, but with this email all are not translated.

How can I solve this issue?


texts: how to store custom collection in cache in admin grid?

texts:
My collection model is testimonial/record. In database table(testimonial_record) 2,00,000 records so it loads more how to decrease time to fetch collection data in grid.So I think I have to store collection in cache to display in grid.is this good approach ? if good approach how to store collection in cache.

How can use below cache function in collection grid ?

Mage::app()->saveCache($data, $this->_cacheId, array(self::CACHE_TAG), 604800);

my Grid.php

protected function _prepareCollection()
        {       $collection = Mage::getModel("testimonial/record")->getCollection();
                $this->setCollection($collection);
                return parent::_prepareCollection();
        }


texts: How to test or style the Order Success Page Or how to stop Success Page redirecting in Magento 2

texts:
I have an issue in Magento 2 success page, its showing blank after successfully placed order. I am trying to debug it but the issue is when trying to refresh the success page after changing the code it a clear current session and redirecting to the home page. I want to stop redirecting the success page and stay the same page when the refresh page.

Have anybody Idea in Magento 2? Please let me know if anyone already does this?


texts: Upgrade magento 2.2.3 to 2.2.8 fatal error

texts:
Hi I upgrade my magento 2.2.3 to 2.2.8 where I have some custom functionality for emails.

After upgrading am getting

Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Mail\Message\Interceptor::clearFrom()

Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Mail\Message\Interceptor::getRawContent()

I have made plugin for public function \Magento\Email\Model\Transport

 beforeSendMessage(\Magento\Email\Model\Transport $subject)
        {
           $message = $subject->getMessage()
           $body = $message->getBody()->getRawContent();
           $message->clearFrom();
           $message->setBody($bodyNew);
        }

its \Magento\Framework\Mail\Message


texts:
/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml is the template responsible for the product list in a category page for example, it loads the products collection and the print it with a classic foreach ($_productCollection as $_product).

Inside the foreach we have:

<?php $iterator = 1; ?>

    <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
    <?php foreach ($_productCollection as $_product): ?>
        <?php /* @escapeNotVerified */ echo($iterator++ == 1) ? '
' : '

' ?>
        ...
        <?php echo($iterator == count($_productCollection)+1) ? '
' : '' ?>
    <?php endforeach; ?>

why not a simpler code like this?

    <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
    <?php foreach ($_productCollection as $_product): ?>

        ...

    <?php endforeach; ?>


texts: Magento 1.8.0.0 Configuration changes won't save

texts:
I'm attempting to change the numbers of items viewed in the Products per Page on Grid Default Value. I've changed the allow all setting to yes, and changed the products per page to 30 (30 is listed in Products per Page on Grid Allowed Values.)

Once I hit "Save congig" it goes through a short cycle, then resets my changes to the default values.

Any ideas?


texts:
Adding the actual product images to a live site, when upload a product image it says 'Could not read config file'

Any Suggestions?


texts: some products are not viewable and not able to add into shopping cart

texts:
i have a product e.g

http://example.com/au/catalog/product/view/id/769 (also not viewable by using
Request Path e.g productname.html)

it redirects me to no-route

http://example.com/au/no-route

anyone knows what is the problem?


texts: Fresh Magento 2.3 Resource Files Not Working After Installed in Windows

texts: Fresh Magento 2.3 installed in windows, after resource check and completed everything successfully installed, then if i open my website i am getting error like,


texts: Magento 2 Customers can't login and add product to cart

texts:
The customers can't login, Magento return a 302 found response

The admin can login without problems.

And I can't add products to cart, Magento returns a 302 found response.

I already do:
Clean cache "magento cache:clean"
Flush cache "magento cache:flush"
Compile "magento setup:di:compile"
Reindex "magento indexer:reindex"

I try to create a new customer and it works, the customer was created without problems, but when I try to add a product isn't work.


texts: How to set sendPasswordResetConfirmationEmail Template seperate for when group id 4 using module

texts:
How to send separate Email template
  (customer_password_forgot_email_template) when

  user Group id=4 using
  module extend Mage_Customer_Model_Customer.

class Creative_Login_Model_Customer extends Mage_Customer_Model_Customer
{
    public function sendPasswordResetConfirmationEmail()
    {
        if (!$storeId) {
            $storeId = $this->_getWebsiteStoreId();
        }

        $this->_sendEmailTemplate(self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY,
            array('customer' => $this), $storeId);
        return $this;
    }

}

  This code working but i want separate mail template for only groupid=
  4.

config.xml

<?xml version="1.0"?>
<config>
   <modules>
     <Creative_Login>
         <version>0.0.1</version>
     </Creative_Login>
   </modules>
   <!-- After login hook -->
   <global>
      <models>
        <creative_login>
           <class>Creative_Login_Model</class>
        </creative_login>
        <customer>
            <rewrite>
                <customer>Creative_Login_Model_Customer</customer>
            </rewrite>
        </customer>
      </models>
      <template>
            <email>
                <customer_password_forgot_email_template translate="label" module="creative_login">
                    <label>Forgot Password</label>
                    <file>account_password_reset_confirmation_creative_login.html</file>
                    <type>html</type>
                </customer_password_forgot_email_template>
            </email>
      </template>
   </global>
   <!-- ##################### -->

   <frontend>
       <!-- ########After login hook######### -->
      <events>
         <customer_login>
           <observers>
              <creative_customer_login>
                 <class>creative_login/observer</class>
                 <method>checkLoginStatus</method>
              </creative_customer_login>
           </observers>
         </customer_login>
      </events>
       <!-- ##################### -->
       <!-- Before login hook -->
        <routers>
            <customer>
                <args>
                    <modules>
                        <creative_login before="Mage_Customer">Creative_Login</creative_login>
                    </modules>
                </args>
            </customer>
        </routers>
   </frontend>
</config>


texts: Conflicts in where clause with ambiguous column names

texts:
A bit of context for this. I want to extend the sales order export function (via the grid) to have more columns. I have created a module which adds a new grid for exporting and also a new collection model which extends the original. This uses the _beforeLoad() function so I can join the tables that I need.

The trouble that I'm having is that when the filters from the grid are added (the increment_id, order date etc), the where clause this adds doesn't prefix the table and I'm getting issues with ambiguous column names. For example, on increment_id I'm having the issue in the where clause:

SELECT `main_table`.*, `sales`.`total_qty_ordered`, `sales`.`entity_id` AS `order_id`, `sagepay`.`vendor_tx_code` FROM `sales_flat_order_grid` AS `main_table`
 LEFT JOIN `sales_flat_order` AS `sales` ON main_table.increment_id = sales.increment_id
 LEFT JOIN `sagepaysuite_transaction` AS `sagepay` ON order_id = sagepay.order_id WHERE (increment_id LIKE '%100000261%') GROUP BY `main_table`.`entity_id`

This where clause is added before I do the joins to the other tables in the _addColumnFilterToCollection() function

protected function _addColumnFilterToCollection($column)
    {
        if ($this->getCollection()) {
            $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
            if ($column->getFilterConditionCallback()) {
                call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
            } else {
                $cond = $column->getFilter()->getCondition();
                if ($field && isset($cond)) {
                    // Filter added at this point
                    $this->getCollection()->addFieldToFilter($field , $cond);
                }
            }
        }
        return $this;
    }

As a brief test, I changed the line to

$this->getCollection()->addFieldToFilter('main_table.' . $field , $cond);

and this worked but it doesn't feel a great way to do it.

My code in _beforeLoad() is

protected function _beforeLoad()
{
    // Join the sales_flat_order table to get order_id and and total_qty_ordered
    $this->getSelect()->joinLeft(array('sales' => $this->getTable('sales/order')),
        'main_table.increment_id = sales.increment_id',
        array('total_qty_ordered' => 'sales.total_qty_ordered',
              'order_id' => 'sales.entity_id'));

    // Join the SagePay transaction table to get vendor_tx_code
    $this->getSelect()->joinLeft(array('sagepay' => $this->getTable('sagepaysuite2/sagepaysuite_transaction')),
        'order_id = sagepay.order_id',
        array('vendor_tx_code' => 'vendor_tx_code'));

    $this->getSelect()->group('main_table.entity_id');
    parent::_beforeLoad();
}

I have to use increment_id to join the sales order grid table and the SagePay transaction table as that is the only common ID I can see.

Basically I'm wondering what the best approach is to tackle this. I could probably get away with doing the change I mentioned above but it doesn't feel right. Is there anything I can change in my join statements?

Thanks.


texts: Magento 2.3 Authorize.net payment Suspected Fraud to Deny Payment not going

texts:
I am using authorize.net capture as default magento payment gateway in magento 2.3 and I have one order coming suspected fraud. but when I will suspected fraud to deny payment and I see error but I can't process continue to Deny Payment

and error like:

Fatal error: Uncaught Error: Call to a member function getAdditionalInformation() on boolean in
/cache/vendor/magento/module-authorizenet-acceptjs/Gateway/Request/VoidDataBuilder.php:50

and error coming below file function:

  vendor/magento/module-authorizenet-acceptjs/Gateway/Request/VoidDataBuilder.php

public function build(array $buildSubject): array
{
    $paymentDO = $this->subjectReader->readPayment($buildSubject);
    $payment = $paymentDO->getPayment();
    $transactionData = [];

    if ($payment instanceof Payment) {
        $authorizationTransaction = $payment->getAuthorizationTransaction();
        $refId = $authorizationTransaction->getAdditionalInformation('real_transaction_id'); //here error line
        if (empty($refId)) {
            $refId = $authorizationTransaction->getParentTxnId();
        }

        $transactionData['transactionRequest'] = [
            'transactionType' => self::REQUEST_TYPE_VOID,
            'refTransId' => $refId
        ];
    }

    return $transactionData;
}

I know here some one ask this question but nothing find any answer it's magento core bug?

i have change as per @sohelrana answer and now another error coming

  Invalid request to gateway.

Any help would be appreciated.

Thanks.


texts: Magento Advanced Search not showing Nav Bar

texts:
I am running Magento 1.7 and I am having a problem getting my Advanced Search to show the next/previous buttons of found products. I have look at the following php pages and everything seems oaky.

frontend\default\erglighting\template\catalog/product/list.phtmlMage_Catalog_Block_Product_List

frontend\base\default\template\catalog/product/list/toolbar/toolbar.phtml

Here is the code of the results page:

 ?>

<?php echo $this->__('Catalog Advanced Search') ?>

 <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
 <?php if($this->getResultCount()): ?>

         <?php echo $this->helper('catalogsearch')->__('%d item(s) were found using the following search criteria', $this->getResultCount()); ?>

 <?php else: ?>

<?php echo $this->helper('catalogsearch')->__('No items were found      using the following search criteria.');?> <a href="<?php echo $this->getFormUrl(); ?>"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?>

 <?php endif; ?>

     <?php $searchCriterias=$this->getSearchCriterias(); ?>
         <?php foreach (array('left', 'right') as $side): ?>
             <?php if(@$searchCriterias[$side]): ?>

                     <?php foreach($searchCriterias[$side] as $criteria): ?>

<?php echo $this->htmlEscape($this->helper('catalog')->__($criteria['name'])); ?>: <?php echo $this->htmlEscape($criteria['value']); ?>

                <?php endforeach; ?>

        <?php endif; ?>
    <?php endforeach; ?>
<?php if($this->getResultCount()): ?>

        <?php echo $this->helper('catalogsearch')->__("Don't see what you're looking for?"); ?>
        <a href="<?php echo $this->getFormUrl(); ?>"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?>

<?php endif; ?>

 <?php if($this->getResultCount()): ?>
     <?php echo $this->getProductListHtml() ?>
 <?php endif; ?>
 <?php $this->getSearchCriterias(); ?>

I have read this article on this board and no luck still:
https://stackoverflow.com/questions/13248461/magento-layered-navigation-on-advanced-search-results

You will notice that there are over 40 products so I should have the nav buttons to navigate between product search results. Here is the site I went to Power Search then selected "ALL" for the Wattage and click Continue and notice with all 44 products and no controls to browse the results.

Can some one please tell what the problem is and why this will not let me whow

Frank G.


texts: Tuning Apache mpm_prefork_module for Magento

texts:
I currently run an AWS EC2 instance (c3.2xlarge) which has 8 CPUs and 16GB of RAM. The Apache version is 2.4.7 (Ubuntu) and my mpm_prefork.conf currently looks like:

StartServers            40
MinSpareServers         40
MaxSpareServers         80
MaxRequestWorkers       1200
MaxConnectionsPerChild  0

mpm_worker.conf (EDIT: not being used)

    StartServers            8
    MinSpareThreads         100
    MaxSpareThreads         300
    ThreadLimit             256
    ThreadsPerChild         100
    MaxRequestWorkers       600
    MaxConnectionsPerChild  0

Has anyone had experience fine-tuning these figures? Currently it's consuming currently 5GB on these settings so I'm thinking this could be tweaked up a bit more.


texts: Where does Magento change HTTP to HTTPS in the HTML code?

texts:
So  I was trying to install a SSL certificate on my website, and I prematurely changed the URL's in Magento from http://www.gekra-motors.nl to https://www.gekra-motors.nl.

Now it turns out my host does not support SSL. Worse, I cannot access my Magento admin panel anymore because I changed the URL's  too soon.Now I can only change things in the back-end (directAdmin) and I have to change the URL's back from https to https. So does anyone have a solution or does anyone know how I can get access to the Magento admin panel?


texts:
I am developing a custom theme for Magento on top of Enterprise and we're trying to use full page cache. We recently discovered that we need some custom placeholders (aka hole punches) in our theme so that Magento can correctly cache and serve up our pages. All of the examples I see for adding additional placeholders involve custom modules or editing core xml files. Because this is a multisite instance with several other unique themes I don't really want to clutter up global namespaces and have a collisions as we grow.

Is there a specific / standard theme level XML file where all fpc placeholder XML should go?


texts: Dashboard time changed to pm and am instead of 24 hours after update

texts:
I'm testing an update from magento 2.3.4 to magento 2.4.1, but one thing i'm struggling with is the dashboard time that changed from digital time to am and pm, i've set the correct timezone in System->Configuration->General->Locale Options->Timezone, but after the update it went to pm and am anyway.
Here some screenshots from before and after:

Does someone have a solution?


texts: How to remove Delete option from massaction dropdown for specific user role in Magento2?

texts:
I have different user role for my website. For a particular user role, I want to remove "Delete" from mass action dropdown which displays on customer grid in admin section.

The Delete option is got rendered from

magento\vendor\magento\module-customer\view\adminhtml\ui_component\customer_listing.xml file.

I want to show this Delete option only for user role1 and want to hide for user role2.

How can we do this?


texts:
As part of creating a custom theme, and partially following the guide on the Magento site, I added a LESS file at:

<theme-dir>/Vendor/theme/Magento_Customer/web/css/source/_extend.less

When I view the CSS in Firebug, it looks like all of my styles from this new file are being used twice on the same element, as if its including _extend.less twice.

About my setup:

Magento is in Development mode
LESS compilation is set to client-side

I confirmed I am still seeing this with server-side compilation

Cache is disabled

Why is this happening?


texts:
I have compilation issue on my custom module. Code works properly in magento 2.1 but in magento 2.2 it's shows error at compilation like this

  Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Vendor\Module\Model\ResourceModel\Products\type;
  File: /var/www/html/magento2.2/app/code/Vendor/Module/Model/ResourceModel/Products/Collection.php

<?php

namespace Vendor\Module\Model\ResourceModel\Products;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface;
use Magento\Framework\Data\Collection\EntityFactoryInterface;
use Magento\Framework\Event\ManagerInterface;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    public function __construct(
    EntityFactoryInterface $entityFactory,
    LoggerInterface $logger,
    FetchStrategyInterface $fetchStrategy,
    ManagerInterface $eventManager,
    $connection = null,
    AbstractDb $resource = null
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
    }

    ...
    ...
}


texts: Magento2 show label on product page if price is with or without tax

texts:
In the EU, you have go to label if a price is incl. or excl. tax in the shop frontend. If you run different shops where you have got both settings, it could be realized with different custom translation strings which are store view specific.
Magento has the information, if a price is incl or excl tax, but the question is how to code it. In Magento1, I solved it with the following code, but so far I have no idea how to do it with Magento2:

<?php $tax_display_type = Mage::getStoreConfig(
               'tax/display/type',
               Mage::app()->getStore()
           );?>
   <?php if ($tax_display_type == 2): ?>
    <?php echo $this->__('Incl. Tax') ?>
<?php else: ?>
    <?php echo $this->__('Excl. Tax') ?>
<?php endif;?>

Any ideas? Thank you very much!


texts: Error while installing magento 2.4.1 through command in ubuntu

texts:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].
- magento/product-community-edition 2.4.1 requires ext-soap * -> it is missing from your system. Install or enable PHP's soap extension.
Problem 2
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/15-xml.ini
- /etc/php/7.4/cli/conf.d/20-bz2.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-curl.ini
- /etc/php/7.4/cli/conf.d/20-dom.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gd.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-intl.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-mbstring.ini
- /etc/php/7.4/cli/conf.d/20-mysqli.ini
- /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-simplexml.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-xmlreader.ini
- /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.4/cli/conf.d/20-xsl.ini
- /etc/php/7.4/cli/conf.d/20-zip.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
I am keep receiving this error i don't know how to resolve it.
if anyone help pls
Thanks in advance


texts:
I'm trying to migrate from Magento 1 to 2 and when I get to this part:

  [2017-10-06 14:04:36][INFO][mode: data][stage: data migration][step: Map Step]: started
  33% [=========>------------------] Remaining Time: 3 mins

I then get this error

  [PDOException]
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

Any ideas?


texts: Free shipping should not work after applying discount coupon and total less than $50?

texts:
I want to apply free shipping for subtotal more than $50 and it's working fine. but if customer applied any discount coupon then free shipping should not apply because grand total is less than $50. For now, Free shipping still applying because Subtotal is still greater than $50.

Can anyone help me how to remove free shipping if Grand total less than $50 after applying discount coupon?


texts: Creating new attribute field in Catalog->Manage Categories->Display Settings

texts:
Im trying to add attribute field in the Display settings in Manage Categories. I found this tutorial on the web http://www.marketingadept.com/blog/magento-developers-add-a-custom-field-to-the-category-admin-page/

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<CmsBlock>

<version>0.0.1</version>
</CmsBlock>
</modules>
<global>
<resources>
<cmsblock_setup>
<setup>
<module>CmsBlock</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
<connection>
<use>core_setup</use>
</connection>
</setup>
</cmsblock_setup>
<cms_block_setup_write>
<connection>
<use>core_write</use>
</connection>
</cms_block_setup_write>
<cms_block_setup_read>
<connection>
<use>core_read</use>
</connection>
</cms_block_setup_read>
</resources>
</global>
</config>

mysql4-install-0.0.1.php

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

$entityTypeId     = $installer->getEntityTypeId('catalog_category');

$attributeSetId   = $installer->getAttributeSetId($entityTypeId);

$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId,5);

$installer->addAttribute('catalog_category', 'cms_block',  array(
    'type'     => 'varchar', /* Type - see eav_entity_* for the different types */
    'label'    => 'CMS Block', /* Your label */
    'input'    => 'select', /* This refers to the type of form field should display*/
    'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'           => TRUE,
    'required'          => FALSE,
    'user_defined'      => FALSE,
    'option'           => array('values'=> array('Option 1','Option 2'))
));

$installer->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'cms_block',
    '52'
);
$installer->endSetup();

the installer script does run as I checked it in the core_resources table but the field does not display on the Display Settings Tab. Can anyone help me with this?


texts: How to add Upload Button for importing a csv file in the Custom Admin Grid Container in magento 2?

texts:
I wish to add import button in my custom admin grid using ui component, in magento 2.

To add this import button which type of grid is better ? ui component grid or php grid.

Note :

  We can fill the grid by clicking add new and fill the form or by
  clicking import button and upload csv file

Please provide me a solution


texts: Turning cache off on a production environment.

texts:
What are the main cons of disabling all of magento's FPC?

If i temporarily turn them off will anything severe result?

Same question for redis?

Currently I'm having an issue with my caching but I'm not sure if the problem is redis or magento FPC. I'm planning on turning of the native FPC for a couple hours this evening. Should I expect anything horrific?


texts: Magento 2.1 - some random error in shopping cart [solved]

texts:
I am running Magento 2.1.1 in apache2.4.
I always see some random errors in the shopping cart.
The cart cannot calculate the grand total(nothing show) and cannot go to checkout page after clicking the checkout button.
This error happens randomly (around 40%) in responsive mobile version.

This is another error triggered.


texts: How to append a string to a magento success page

texts:
I'm making a customization of this module for my personal magento module for an external gateway.
I need to create a redirect URL for success page like this:

http://www.mywebsite.com/index.php/checkout/onepage/success?payementID=12345678

Is it correct to use this way?

Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true, '_query'=>'?paymentID=12345678'));

Can you tell me how to do?


texts: Magento 2: How to send newsletter on defined time?

texts:
I create one newsletter template and try to send customer , i also run the cron but customer not get newsletter,

please help me how can i do that? In screenshot you can see status is Not sent., please help me


texts: 500 internal server error on magento 2 live server website is not going to be launched

texts:
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@shamareen.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log


texts: How to update a custom category attribute?

texts:
I have created a category attribute is_personalizable.

Below is mysql4-install-0.0.1.php

<?php
$installer = $this;
$installer->startSetup();
$attribute  = array(
    'type'          =>  'text',
    'label'         =>  'Is Personalizable>',
    'input'         =>  'select',
    'global'        =>  Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible'       =>  true,
    'required'      =>  false,
    'user_defined'  =>  true,
    'default'       =>  "0",
    'group'         =>  "General Information",
    'option'        => array(
                            'value' => array(
                                '0' => 'No',
                                '1' => 'Yes',
                            )
                        ),
);
$installer->addAttribute('catalog_category', 'is_personalizable', $attribute);
$installer->endSetup();
?>

Unfortunately I did a mistake on the label field. So I try to update the attribute. Below is my mysql4-install-0.0.2.php

<?php
$installer = $this;
$installer->startSetup();

$installer->updateAttribute('catalog_category','is_personalizable','label', 'Is Personalizable?');

$installer->endSetup();
?>

But the change is not reflecting, I am not sure whether the file is being executed or not?

Below are the questions:

1. Whats the mistake on the update?
2. Creating and updating attribute will have to sql version .php files, so when I migrate from one server to another how magento will
know the version 1 and 2 so on.
3. How to know whether my update query executed or not?

Please advise.


texts: custom css not working in my inherited child theme

texts:
I am using ultimo theme for my store. Problem is in its _custom.less file there is written to make a new child theme for customizing the css. I have made the new theme but the problem is I am not able to customize it any way.All the theme is inherited successfully but when I changed the css it is not changing . What am I missing ?
This is my child theme directory.

app>design>frontend>Vendor>Child_theme_name>web>css>source>_theme.less


texts: Restrict access to categories and products

texts: How can turn off the display of categories and products in them for unauthorized users. In case of transition to url of not logged user, redirect to login page.


texts: Magento 2.0.14 and 2.1.7 security update - possible issues?

texts:
Reference: Magento 2.0.14 and 2.1.7 security update

How can I apply the 15 patches in older versions like 2.0.13 or 2.1.6?

What are the possible issues?


texts: Magento1 submit order process is very slow for customers having 100s of order in account

texts:
We're observing slow submit order process for few customers who've 1000s of orders in their account. Order submit process take Approximately 2 to 3 Minutes to place order. We're placing order from admin.

Order submit is working fine for other customers, there are only issues with customers who've 1000s of order in their account.

We're using Magento EE version, Archive Sales Order functionality is enabled in system.

Current Magento version is 1.14.3.3

Any Idea what is wrong?


texts:
In magento 2, I've created a recently viewed items using Magento Reports block. Now I need to show prices for only registered users.

I have 2 problems,

price is rendered by following php code,

echo $block->getProductPriceHtml(
    $_item,
    \Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
    \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
    [
        'price_id_suffix' => '-' . $type
    ]
);

When it renders, chrome inspector shows multiple div classes and spans, which makes my css obsolete. I need to just get the price value given from above block and put inside my own div block. How can I do that? From where this price comes from?

please help me


texts:
How to fix file permission, we don't want every time make command for sudo chmod -R -v 777 var

Using Linux,centos7,cloud server.having 3 accounts.
About file permission, sometime getting warning can't inside the website, need to refresh 2~3 times.

{"0":"Warning: file_put_contents(\/home\/xxx\/public_html\/var\/cache\/\/mage-tags\/mage---b8e_CONFIG): failed to open stream: Permission denied in


texts: Looking for a plugin for "0 results" pages

texts:
I'm looking for a plugin or extension that will be able to customize and show "realted products"/"best sellers" or catagories if there are no results found. Also be able to customize it with suggestions and related terms.

Thanks in advance.


texts: Uncaught TypeError: Argument 1 passed to Magento\Framework\App\Config\ScopePool::__construct()

texts:
After installing elasticsearch module, I am getting an error while accessing search api. Same module is working fine in a fresh magento. But it produces error in my existing project. I tried by disabling all other modules, but in vain.

Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\\Framework\\App\\Config\\ScopePool::__construct() must implement interface Magento\\Framework\\App\\Config\\Scope\\ReaderPoolInterface, instance of Smile\\ElasticsuiteCore\\Model\\Search\\Request\\RelevanceConfig\\ReaderPool given

Can anyone help with any help with this error message?