texts: How to trigger 3rd party api when button onclick?

texts:
I want to trigger a 3rd party api when admin clicking on the 'Send Contract'button in Sales Order View.

This is the code for my button plugin:
<?php
  namespace MarsMage\Eversign\Plugin\Sales\Block\Adminhtml\Order;

  use Magento\Sales\Block\Adminhtml\Order\View as OrderView;

  class View
{
public function beforeSetLayout(OrderView $subject)
{
    $subject->addButton(
        'send_contract_button',
        [
            'label' => __('Send Contract'),
            'class' => __('send-contract'),
            'id' => 'send-contract-button',
            'onclick' => 'setLocation(\'' . $subject->getUrl('module/controller/action') . '\')'
        ],
    );

    $subject->addButton(
        'send_hire_purchase_button',
        [
            'label' => __('Send Hire Purchase'),
            'class' => __('send-hire-purchase'),
            'id' => 'send-hire-purchase-button',
            'onclick' => 'setLocation(\'' . $subject->getUrl('eversign/sendhirepurchase') . '\')'
        ],
    );
}

 }

This is the code for my controller:
<?php
  namespace MarsMage\Eversign\Controller\Adminhtml;

  use Magento\Framework\App\Action\Context;

  class SendHirePurchase extends \Magento\Framework\App\Action\Action
   {
      /** @var  \Magento\Framework\View\Result\Page */
      protected $resultPageFactory;

     /*** @param \Magento\Framework\App\Action\Context $context      */
      public function __construct(
         Context $context,
         \Magento\Framework\View\Result\PageFactory $resultPageFactory,
          \MarsMage\Eversign\Helper\Data $data
           )
       {
         $this->resultPageFactory = $resultPageFactory;
            $this->helper = $data;
         parent::__construct($context);
          }

       public function execute()
       {
         $this->sendHirePurchase();
        }

       public function sendHirePurchase()
       {
         try {

        $postData = [

    'sandbox' => 0,
    'template_id' => 'b4edc68efca14b44a6aec31c6a7ad9dd',
    'title' => 'Hire Purchase Agreement',
    'message'=> 'This is my message.',
    'custom_requester_name' => '',
    'custom_requester_email' => '',
    'redirect'=> 'https://myredirect.com/completed',
    'redirect_decline' => 'https://myredirect.com/declined',
    'client' => '',
    'expires'=> 1494276966,
    'embedded_signing_enabled' => 0,
    'signers' => [

    [
        'role'=> 'Client',
        'name'=> 'Chris',
        'email' => 'chris@marslab.com.my',

        'message' => 'This is my custom message to Paul.',
        'deliver_email' => '',
        'language' => 'en'
    ],

],
    'recipients'=> [

    [
        'role' => 'Motorkap',
        'name' => 'Motorkap',
        'email' => 'admin@motorkap.com',
        'language' => 'en'
    ],
],
    'fields' => [
        [
        'identifier' => 'full_name',
        'value'=> 'Chris Lee'
        ],

        [
        'identifier' => 'cash_price',
        'value'=> 12000
        ],
]];

        $apiKey = "9b735cc49cf593754c8cc54cec2cc71eReset";
        $business_id= "280557";
       $url="https://api.eversign.com/api/document?access_key=" . $apiKey . "&business_id=" . $business_id;

        $this->curl->post($url, $postData);
        // Response Text
        $response = $this->curl->getBody();
        // Response Header
        $responseHeader = $this->curl->getHeaders();
        // Response cookies
        $responseCookies = $this->curl->getCookies();
        return $response;
    }
catch (Exception $e) {
    $return = ["status"=>false, "message"=> $e->getMessage()];
}
  }
    }

When I put the url in button onclick, it always return me invalid form key. What is the exact solution to trigger api when button onclick?


texts: How to insert static block into header with local xml?

texts: I have made a simple static block which is just an unordered list containing social links that I would like to place into my header. How would I go about inserting it into my header via local.xml? thanks


texts:
I have tried everything to change the PayPal image at checkout in magento 1.9.1 CE.
We set up PayPal standard which also enables PayPal Express. We are not using any of the premium products from PayPal, just standard.
Apparently you can only change that image if you have one of their premium services, payflow pro, etc.
We want to switch the image to a credit card Paypal image.  Our customers don't know we can take any credit card though PayPal.
I tried editing:
mark.phmtl, shortcut.phmtl and logo,phmtl.
No luck, still shows the default logo.


texts:
I want to create an admin grid.
Taking the reference to https://www.mageplaza.com/magento-2-module-development/create-admin-grid-magento-2.html, I can see there are following two ways :

Using Component
Using Layout

My question here is which one is better and why?


texts:
I've posted on a couple of places on the magento site and I've left two messages on the voicemail for the 877 number. I have money available, I just can't figure out how to spend it.

Sorry for such a dopey question, but I just can't find anybody at home at Magento to speak to.


texts: Magento 1.9 REST Customer Password Field Unable To Save

texts:
Been using REST to create or update Customer record but the field password never able to be saved/updated regardless.

Below is the JSON output to Magento REST:

POST output:
{"website_id":1,"email":"00010@mycompany.com","group_id":1,"disable_auto_group_change":0,"prefix":"","firstname":"Newer10","middlename":"","lastname":"Corporation","suffix":"","taxvat":"","password":"Password123","password_confirmation":"Password123"}

The password at the end is MD5 hashed. I also tried plain text password and MD5 hash with salt separated by a colon.

To verify the record, I used Admin page > Manage Customers and verified record has been created.

However, when I tried to log in using the new email 00010@mycompany.com it's unable to log in due to an invalid username or password.

Also, I checked the database table, the password field was never created.

I put a Mage::Log before and after the $customer->save(); function and here are the latest result:

2015-07-17T08:53:39+00:00 DEBUG (7): array (
  'website_id' => 1,
  'group_id' => 1,
  'disable_auto_group_change' => 0,
  'prefix' => '',
  'firstname' => 'Newer10',
  'middlename' => '',
  'lastname' => 'Corporation',
  'suffix' => '',
  'email' => '00010@mycompany.com',
  'taxvat' => '',
)
2015-07-17T08:53:39+00:00 DEBUG (7): array (
  'website_id' => 1,
  'group_id' => 1,
  'disable_auto_group_change' => '0',
  'prefix' => '',
  'firstname' => 'Newer10',
  'middlename' => '',
  'lastname' => 'Corporation',
  'suffix' => '',
  'email' => '00010@mycompany.com',
  'taxvat' => '',
  'store_id' => '0',
  'entity_type_id' => '1',
  'parent_id' => 0,
  'created_at' => '2015-07-17 08:53:39',
  'updated_at' => '2015-07-17 08:53:39',
  'created_in' => 'Admin',
  'confirmation' => NULL,
  'entity_id' => '24',
)


texts:
I follow this Magento guide to work with Magento API REST (New Learner):
http://devdocs.magento.com/guides/v2.2/get-started/order-tutorial/order-create-customer.html

In this step I try run this curl line to create a new customer:

curl -X Post "http://domain/api/rest/default/V1/customers"\
    -H "Content-Type:application/json"\
    -d '{"username":"example", "password":"example"}'

and get "curl: (6) Couldn't resolve host".

Also I want to ask, can I call this request with Postman?


texts:
I have the following Magento 1 code and I would like to know the Magento 2 equivalent of the code.

I've looked around on the web but unable to find a proper solution.

Mage::getModel('core/resource_transaction');


texts: Filter product collection by multiple categories?

texts:
I have this snippet of code that gets the most recently added products:

$_productCollection = Mage::getResourceModel('catalog/product_collection')
                ->addAttributeToSelect('*')
                ->addAttributeToFilter($preorderAttribute, array(
                    'eq' => Mage::getResourceModel('catalog/product')
                        ->getAttribute($preorderAttribute)
                        ->getSource()
                        ->getOptionId($preorderValue)
                ))
                ->setVisibility(array(2,3,4))
                ->setOrder('created_at', 'desc')
                ->setPage(1, 12);

I want to further filter this by category, for example, categories with id 3 and 4. Only products from 3 and 4 categories are selected in the collection. How can I achieve this?

I tried to use addAttributeToFilter to filter by category IDs but there seems to be a variety of different ways to do it, and it's neither not working or simply gives a Fatal error:

  Call to a non-member function getBackend()

....now I'm at a loss.

Any help would be appreciated.


texts: Need a password protection extension that can restrict my categories or products. So that user needs a password to access these categories or products, Is there any extension? Refer me.


texts: How to Uninstall modules in Magento 2 using composer?

texts: How to Uninstall modules "ub data migration" in Magento 2 using composer


texts: Magento 2 Custom MassAction redirects to dashboard with "Invalid Security Token" but works?

texts:
I created a custom mass action, and it shows up and seems to function fine except rather than redirecting back to the order page, it goes to the admin dashboard and says the typical "Invalid security or form key. Please refresh the page."
I've removed most of the code for the actual mass action part of it and narrowed it down to something I must be doing wrong with the redirect.
I've done the usual setup:di:compile, setup:upgrade, cache:flush to attempt to fix it but I am stuck with this for now.
Here's my MassAction.php
<?php

namespace Vendor\Module\Controller\Adminhtml\Export;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\Controller\ResultFactory;

class Pdf extends \Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction
{
    protected $fileFactory;
    protected $csvProcessor;
    protected $directoryList;
    protected $timezone;
    protected $request;
    protected $scopeConfig;
    protected $collectionFactory;
    protected $_orderHelper;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Ui\Component\MassAction\Filter $filter,
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $collectionFactory,
        \Magento\Framework\App\Response\Http\FileFactory $fileFactory,
        \Magento\Framework\File\Csv $csvProcessor,
        \Magento\Framework\App\Filesystem\DirectoryList $directoryList,
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ){
        parent::__construct($context, $filter);
        $this->fileFactory = $fileFactory;
        $this->csvProcessor = $csvProcessor;
        $this->directoryList = $directoryList;
        $this->collectionFactory = $collectionFactory;
        $this->timezone = $timezone;
        $this->scopeConfig = $scopeConfig;
    }

    protected function massAction(AbstractCollection $collection)
    {
        $orderIds = $collection->getAllIds();

        file_put_contents("/report.txt","Works"); // this is fired and written to disk

        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $resultRedirect->setPath($this->getComponentRefererUrl()); // rather than returning to the order panel, it does to the admin dashboard?

        return $resultRedirect;
    }
}


texts: Three products for a single price when checkout

texts:
I am trying to give an offer to my website users where they can choose three
T-shirts and pay only ₹999 irrespective of the cost of each t-shirt.
I have tried to achieve this through cart price rules but i was not able to achieve what i expected. Can anyone help me out with this???
the following is my website link.
https://habit69.com


texts: Magento : How to Change Copyright in Footer

texts: I am trying to change copyright on my website from 2011 to 2011-2017. I have gone through system/configuration/design/footer/copyright and have attempted to change it with no luck. I have tried to go through files of my website but I have no which file footer would be in.


texts: What's the correct cookie config for a Magento site split across multiple instances as subdomains?

texts:
The problem

A large site uses separate instances of Magento for different geographic regions so the businesses are isolated. Example:

site.com
north.site.com
south.site.com
east.site.com
west.site.com

Users may visit the root + regional sites, log in directly on a regional site, or log into (site.com) with their regional credentials (we have an authenticator + redirect in place).

Some are unable to login after previously being able to, and get no error feedback. We can replicate the fault which is having two cookies with the same name but different domains. Example:

Name: frontend, Domain: .site.com
Name: frontend, Domain: .north.site.com

Deleting the cookies resolves the issue in most browsers. The cookies seem to get stuck in some browsers and we're stumped other than waiting for them to expire which sucks for users.

What we tried

Initially our config was blank (as below) for all sites. This triggered the problems. As I understand it, we need to set the domain explicitly for all sites to ".site.com" so only one cookie can exist with that name/domain.

Does that resolve Magento's issue of not knowing which "frontend" cookie is the correct one — or is there a preferred config?

The Question

What is the correct cookie config in Magento's admin for a multi-domain setup?

See: "System > Config > Web > Session Cookie Management"


texts: Not able to apply free shipping method when selecting custom customer group

texts:
I have created a new custom customer group, then i created a new cart rule to apply free shipping & assign that rule to new custom customer group. When i go to checkout page i am not getting Free shipping method.
Any suggestion will be appricated.
Thanks in advance.


texts:
How to set date format for ui component grid and how to set the default '--'  symbol for date.

Thanks.


texts: Magento 2 : User Agent Conditional In Layout

texts:
Is there any way by which I can include block or .phtml in my theme layout?

For e.g. I've a .phtml that I only want to include when site is visited in Mobile devices.

How to achieve this?

Any help would be appreciated.


texts:
I have a custom db table called "membership". The table appears as below:

membership_no(pk) | bronze | silver | gold

1000001           |   no   |   no   |  yes
1000002           |   yes  |   no   |  no

What id like to do is:

Add a custom field to registration form that asks for membership number.
Validate membership number input against database and if value exists get that row.

3 Assign the customer to a customer group dependent on membership type of the selected row?

Any ideas? (using v1.7.0.2)

Thanks

Stefan


texts: direct sql query or collection fast for fetch large data collection in magento?

texts:
I need a suggestion in magento.

I have created custom model collection.it has around 50,000 rows in testimonial_record. I want to fetch simply all data.

Which following query is best to fetch fast data ?

Technique 1:

$resource = Mage::getSingleton('core/resource');

        $readConnection = $resource->getConnection('core_read');

$query = 'SELECT * FROM ' . $resource->getTableName('testimonial_record');

        $results = $readConnection->fetchAll($query);

Technique 2:

$collection = Mage::getModel('testimonial/record')->getCollection();

Which one above technique is best to fetch fast bulk data ?
OR any other query to fetch fast data from custom table ?


texts: Checkout: is there a shop search input field by default?

texts:
Problem:

On checkout page there is a "Sign In" link that overlays mini-cart-icon/search ...

I have no completly fresh installation, but i doubt it come from any extension. (they do not effect checkout or header)

I just quickly checked checkout in some M2 demo stores and noticed two things ...

there is no search or mini-cart on other pages
there is not even a top bar on other pages

Is it possibly a config setting or its maybe related to multistore-setup?

Tested with 2.2.5 and updated to 2.2.6 ...

Any ideas (before i test it on clean install :P)?


texts: Magento 2.2.4 Web Setup Wizard 'This page isn't working'

texts:
I have freshly installed Magento 2.2.4 through softaculous installer in cPanel.
After finish installing, Admin > System Web Setup Wizard not working. The link redirects me to ..../setup and it shows 'This page isn't working ....com is currently unable to handle this request. HTTP ERROR 500'. Please check screenshot.

Anyone has a fix for this?


texts:
In magento 1.x you called the block template processor such as

$helper = Mage::helper('cms');
$processor = $helper->getBlockTemplateProcessor();

echo $processor->filter($somecontent)

This would allow you to take advantage of variables, widgets and WYSIWYG features etc. I'm trying to figure out where the processor now resides in Magento 2.x and the best practice for parsing content through it.

Built out a model Testing\Testmodule\Model\Processor.php using the below code by Amit,

namespace Testing\Testmodule\Model;

class Processor extends \Magento\Framework\View\Element\AbstractBlock implements \Magento\Framework\DataObject\IdentityInterface
{

public function __construct(
    \Magento\Framework\View\Element\Context $context,
    \Magento\Cms\Model\Template\FilterProvider $filterProvider,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Cms\Model\BlockFactory $blockFactory,
    array $data = []
) {
    parent::__construct($context, $data);
    $this->_filterProvider = $filterProvider;
    $this->_storeManager = $storeManager;
    $this->_blockFactory = $blockFactory;
}

protected function content()
{
    $blockId = 'testblock';
    $html = '';
    if ($blockId) {
        $storeId = $this->_storeManager->getStore()->getId();
        /** @var \Magento\Cms\Model\Block $block */
        $block = $this->_blockFactory->create();
        $block->setStoreId($storeId)->load($blockId);

            $html = $this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent());
    }
    echo  $html;
}

}

And then I am calling the model inside my controller with

$processor = $this->_objectManager->create('Testing\Testmodule\Model\Processor')->content();

It is returning

Fatal error:  Class Testing\Testmodule\Model\Processor contains 1 abstract

method
 and must therefore be declared abstract or implement the remaining methods (Magento\Framework\DataObject
\IdentityInterface::getIdentities) in /croot/www/mag2rc1/app/code/Testing/Testmodule
/Model/Processor.php

I've even tried including the class directly in the index controller and the same error is returned. Any insight into why this would be happening.


texts: Controlling order of blocks in Magento layout.xml - jQuery CDN appearing after added skinjs

texts:
Having some trouble rendering jQuery in my Magento theme via local.xml in an appropriate position.

Currently, the section in question in my layout.xml looks like so:

<!-- load jQuery from CDN with local fallback, latest version 1.11.0 -->
<block type="core/text" name="google.cdn.jquery">
    <action method="setText">
        <text><![CDATA[<script src="//code.jquery.com/jquery-1.11.0.min.js"></script><script>window.jQuery||document.write('<script src="js/jquery-1.11.0.min.js">\x3c/script>');</script><script>jQuery.noConflict();</script>]]></text>
    </action>
</block>

<!-- add global JS functions library -->
<action method="addItem"><type>skin_js</type><name>min/global-min.js</name></action>

However the global-min.js file here is rendered before jQuery, which (along with other added core/text type blocks) is sitting after the rest of my skin JS files.

Is there a way to move the CDN loaded jQuery file up in terms of output priority inside the head of my site?

Thanks very much for your help.

Note: apologies if this is considered bad practice but I'm reposting a question I posted on StackOverflow (https://stackoverflow.com/questions/25349584/controlling-order-of-blocks-in-magento-layout-xml-jquery-cdn-appearing-after-a) as I thought this might be a more appropriate forum.


texts: Magento 2 : disable cache for static block

texts:
In Magento, I can disable cache for static block by add cache_lifetime="null".

{{block type="core/template" cache_lifetime="null" title="BEST SELER!!!" sku="ASS030530010" template="catalog/product/menuproduct.phtml"}}

How can I disable cache for static block on Magento 2?


texts: How to comment new CMS block on the page?

texts:
I was building my website and I am facing an issue there.

I created CMS block for the page and added this in the upper section of my page.

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

I put reference name in to local.xml like this.

<reference name="footer">
    <block type="cms/block" name="footer-company" as="footer-company">
        <action method="setBlockId"><block_id>footer-company</block_id></action>
    </block>
</reference>

and this seems to be not working at all. I also tried to add this manually for home page under Design tab and I got an error for that.

So my question is, Is there any other way to put this CMS block on my page?
I think that local.xml doesn't work any more with Magento 1.9.


texts: How to call front controller from javascript?

texts:
How can I call my custom controller through javascript?
Any way by which I can pass the url of controller and call that with "parameter"?


texts: Magento 2 - Share customers but not cart between multiple websites or stores

texts:
We have a Magento 2.2.8 multi-store setup with 3 websites.

One has 2 stores which allows us to share customers between them. However I don't want to share carts between the stores (different products / attribute set).

I'm open to having each store as a separate website (it's easier for product management) but then we lose the ability to share customers as these cannot be shared with global scope.

Therefore, is there an easy way to
1) share customers between selected websites (preferred option, share between 2 websites out of 4)
2) have a separate cart/quote per store

I've looked at the customers module where account scope is set, but trying to limit via IDs doesn't seem to work. Likewise in the quote module while an array of store IDs is passed to load a quote, the loadWithoutStoreIds seems to be called and even hard coding an id to test doesn't seem to work.

Any help appreciated.


texts: How can I get European countries list in magento 2?

texts: I have a custom checkout page for samples, Where I want to get list of European countries list in magento 2.


texts: Magento 2.0 Checkbox required validation not triggering

texts:
the checkbox required field validation in my code doesn't seem to get triggered on submit although the other input fields are validated.  Can any of you check out what the hell's wrong in my code?

        <?php  echo __('Item Delivery Options') ?>

        <?php foreach($deliveryOptionList as $key => $deliveryOptionItem): ?>

                <input class="radio validate-one-required-by-name" type="checkbox" name="rahahaha_data[delivery_options][]" value="<?php echo $key; ?>"> <?php echo $deliveryOptionItem; ?>
            &nbsp;&nbsp;&nbsp;
        <?php endforeach; ?>

This is how the output looks like:

    Item Delivery Options

    <input class="radio validate-one-required-by-name" type="checkbox" name="rahahaha_data[delivery_options][]" value="1"> Rahahaha - online payment&nbsp;&nbsp;&nbsp;

    <input class="radio validate-one-required-by-name" type="checkbox" name="rahahaha_data[delivery_options][]" value="2"> Rahahaha - cash on delivery&nbsp;&nbsp;&nbsp;

    <input class="radio validate-one-required-by-name" type="checkbox" name="rahahaha_data[delivery_options][]" value="4"> Sellers delivery&nbsp;&nbsp;&nbsp;

    <input class="radio validate-one-required-by-name" type="checkbox" name="rahahaha_data[delivery_options][]" value="5"> Buyers pick-up&nbsp;&nbsp;&nbsp;

Thanks guys


texts: Less variables set in _theme.less are being override elsewhere

texts:
I'm attempting to change the button color in my magento theme. In my app/design/frontend/JK/PPC/web/css/source/_theme.less I have the following:

/*
 * Buttons
 */
@button__color: @color-gray20;

/*
 * Navigation
 */
@navigation__background: @color-white;

The navigation background changes fine, but the button color doesn't change. I've checked in dev tools and I notice it's being overriden by .action.primary

I have nothing in my own code that overrides this. The only files I have under web are web/css/source/_blocks.less (my custom blocks styles), _theme.less and _styles.less which contains:

@import 'source/lib/_lib.less';
@import 'source/_sources.less';
@import 'source/_components.less';
@import 'source/_blocks.less';

My theme is based on the blank theme. Any ideas what I'm doing wrong?


texts: Customer e-mail is missing in order email Magento 2. How to add it?


texts:
If I comment out <block class="Magento\Checkout\Block\Cart\Coupon" name="checkout.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
in
E:\Projects\Cupolas\app\design\frontend\tv_themevast_package\default\Magento_Checkout\layout\checkout_cart_index.xml the discount code box does not show up.
But the correct way to do this is by adding <referenceBlock name="checkout.cart.coupon" remove="true"/> in E:\Projects\Cupolas\app\design\frontend\tv_themevast_package\default\Magento_Checkout\layout\checkout_index_index.xml but when I both clear the cache and deploy (though overkill) my cart still shows the discount block.
What may I be missing?


texts:
I am new to Magento.  How can I add a new report to do the following:

Find all enabled SKU's without any images using PHP code?

I know that the site has a post on how to find these items, but I am not sure how I generate that into a report.

The user stated that add the code to "Magento" root.  Being new, I am not sure what this means and what is magento root

Thanks


texts: Bundle Product Options as thumbnails or swatches - Magento 2

texts:
I have a sofa
It is a frame + 3 cushions that we sell as a set.
We have cushions in colors red green and yellow.
What I want to do is
Create a bundle that has
Option 1 - Frame
                  Products FRAMESKU - Qty 1
Option 2 Cushion
Products
Green-cushion Qty 3
Yellow-cushion qty 3
red-cushion qty 3

BUT
Instead of word choices for colors, I want to show a color swatch.
AND
Instead of no image, I want to flip the main image based on the option chosen. So when someone chooses a green cushion, a sofa frame with green cushions shows up.

I can create a bundle  without the images now (with only words, and with only the main image) - but I need to show customers the actual color of the bundle product as a swatch and if possible change the main image to match.

I want to show the thumbnails/swatches on the right block, below the price.

Why am I doing this? Because the Bundle Product allows me to ship separately and therefore lists out the components. I can then use the skus at a component level for tranfer to our accounting system (QUickbooks) as well as creating very simplified packing lists that people do not need to translate from a dynamic sku to component parts.

Is this possible? I think it should be but I would like some help.  I am open to some consulting help.

Thanks very much in advance.
Sam


texts: Set default value on select of page layout in cms_page_form.xml

texts:
I would like to set a default value for the select on the page layout when creating a new cms page in magento 2. The file I'd like to make an extension for is cms_page_form.xml under module-cms > view > ui_component. Unfortunately  <item name="default" xsi:type="string">2</item> to set the second item in the list as default, isn't working. Any thoughts on how to do this in xml?

<field name="page_layout">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Cms\Model\Page\Source\PageLayout</item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Layout</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="source" xsi:type="string">page</item>
                <item name="dataScope" xsi:type="string">page_layout</item>
            </item>
        </argument>
    </field>


texts: how to add text in Manage Products -> Product -> Images in magento 1.9.3 admin panel

texts:
I want to inform the user that upload a particular size of images for products in admin panel for symmetry in design on frontend so I want to add text at images tab of manage products. Following is the picture and I have put arrow sign where I want to add text.

I search in coding but nothing found. Any help will be appreciated. Thanks in advance.


texts: Magento checkout page reorder checkout step

texts:
I have install third party extension of Ipragmatech.
I want to make the step defined by this extension as default checkout step or 1st checkout step
i have made changes in

Ipragmatech/Checkoutstep/Block/Onepage.php
as

class Ipragmatech_Checkoutstep_Block_Onepage extends Mage_Checkout_Block_Onepage
{
    public function getSteps()
    {
        $steps = array();

        if (!$this->isCustomerLoggedIn()) {
            $steps['login'] = $this->getCheckout()->getStepData('login');
        }

        //check that module is enable or not
        if (Mage::helper('checkoutstep')->isEnabled()) {
             $stepCodes = array('checkoutstep','billing', 'shipping', 'shipping_method', 'payment', 'review');
        }
        else {

            $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');
        }
        foreach ($stepCodes as $step) {
            $steps[$step] = $this->getCheckout()->getStepData($step);
        }

        return $steps;
    }
    }

but code was not working properly by default it goes to Billing step

in default checkout step in /app/code/core/Mage/Checkout/Block  redefined as

public function getActiveStep()
  {
return $this->isCustomerLoggedIn() ? 'checkoutstep' : 'login';

}

after doing this step is being displayed in checkout step but not working
it default follows step as
  login->billing->shipping->checkoutstep(this step i want to be 1st open )->

step is being displayed first but after shipping method this step get enabled.


texts: Magento 1.9 is not sending the order confirmation e-mail

texts:
I'm placing an order in Magento but I never receive the Order confirmation e-mail. I think that crons are set up properly. In : System->Advanced->System I set the Heartbeat task schedule (cron syntax) to */5****.
Any help would be appreciated.

Thank you in advance.


texts:
I have the following line of code

$select =  $read->select()
            ->from($batchTable,array('id','batch','strength','flavor','brand'))
            ->where('status', 1)
            ->order('created DESC') ;

How do I do multiple where statements?


texts: Website red page highlight with crosshairs tool?

texts: I was just busy working on a Magento website with the chrome developer tools open. I'm not sure what I pressed but all of a sudden my mouse turned into a crosshair and everything except the block I was hovering over turned a see through red color. It was similar to when you choose "Select an element in the page to inspect it" in developer tools, except with that option the item you are selecting changes color and this time it was everything other than the item I was selecting. When I clicked on the page an information box opened in the bottom right of my screen with the path of image I was hovering over and some other information underneath. I clicked to close it too fast and now want to know what it was I opened. Does anyone know what this tool is?


texts: Modify System Attribute - Add an option to msrp_display_actual_price_type attribute

texts:
I want to add a "call for price" or "price on application" functionality to a site which basically hides the price and add to cart buttons for a product.

I have created another attribute for now however feel it would be neater to use the msrp_display_actual_price_type attribute and add a "Price on Application" option as this is the logical place for it to go.

This is however a system attribute and from within admin there seems to be no way to add options to this attribute.

There seems to be a similar question here Magento2: Editing attribute 'country_of_manufacture' is impossible however this states it's not possible but surely there is a way or atleast should be at your own risk adding a value shouldn't do much harm.

So far im thinking to just override magento/module-msrp/Model/Product/Attribute/Source/Type.php within a custom module. Adjusting like so:

<type name="Magento\Msrp\Model\Product\Attribute\Source\Type">
    <plugin name="callforprice_updatepoa" type="Harrigo\CallForPrice\Plugin\Updatedap"/>
</type>
<!--<preference for="Magento\Msrp\Model\Product\Attribute\Source\Type" type="Harrigo\CallForPrice\Model\Updatedap" />-->

  di.xml

I tried with preference however this did not seem to do anything however with plugins i could modify and add the value which shows and saves fine everything seems to work however i could not access the protected variable $this->_options and so have to skip the if statement that checks is it is set. Can i get away access with this / access this variable at all?

    if (!$this->_options) {
        $this->_options = [
            ['label' => __('On Gesture'), 'value' => self::TYPE_ON_GESTURE],
            ['label' => __('In Cart'), 'value' => self::TYPE_IN_CART],
            ['label' => __('Before Order Confirmation'), 'value' => self::TYPE_BEFORE_ORDER_CONFIRM],
        ];
    }
    return $this->_options;

  Original Function

<?php
namespace Harrigo\CallForPrice\Plugin;

class Updatedap
{
/**
 * Display Product Price on gesture
 */
const TYPE_ON_GESTURE = 1;

/**
 * Display Product Price in cart
 */
const TYPE_IN_CART = 2;

/**
 * Display Product Price before order confirmation
 */
const TYPE_BEFORE_ORDER_CONFIRM = 3;

/**
 * Price on Application
 */
const TYPE_PRICE_ON_APPLICATION = 4;

function afterGetAllOptions($subject)
{
    $_options = [
        ['label' => __('On Gesture'), 'value' => self::TYPE_ON_GESTURE],
        ['label' => __('In Cart'), 'value' => self::TYPE_IN_CART],
        ['label' => __('Before Order Confirmation'), 'value' => self::TYPE_BEFORE_ORDER_CONFIRM],
        ['label' => __('Price on Application'), 'value' => self::TYPE_PRICE_ON_APPLICATION],
    ];
    return $_options;
}
}

  Plugin


texts: Uncaught ReferenceError: jQuery is not defined in onepage checkout

texts:
I am getting this error Uncaught ReferenceError: jQuery is not defined
with 400 error on the debug programmer console of chrome. The problem when loading is in checkout onepage and the continue button is not working.
I supose this is related to a non reference to jquery. How can we link to this .js file and where should i look for it? I believe this is related to the theme i am used but it worked in the past.

After more debugging i am getting the conclusion that the button on the page is missing the html tag for calling the js function that was suposed to be in it.
This is the html page:

After looking in the magento files there are only 2 files that can generate that code located at:
app\design\frontend\base\default\template\checkout\onepage\billing.phtml
app\design\frontend\base\default\template\persistent\checkout\onepage\billing.phtml

The odd thing is i have tested change or remove the files but the page error is still generated. I have cleared the magento cache in admin and in /var/cache


texts: "No payment method" appears in checkout page for product with recurring profile

texts:
I created a product with recurring profile in Magento ver. 1.9.3.1. However, I found that the checkout page shows "No Payment Methods" under the Payment Information section if the product in shopping cart had recurring profile, but all the payment methods were showing properly for the non-recurring product.

I have enabled the Braintree sandbox in the "Payment Methods" and the non-recurring products could checkout successfully with Braintree.

May I know if there is any config that I need to set in the Payment Method for the products with recurring profile.

Thanks!


texts: no such entity with cartid = 0 on checkout page Magento 2.4.0

texts: I am getting very strange issue. I have created my custom Checkout extension which is working fine until Magento version 2.3.X but when I checked it in Magento 2.4.0 then I am getting no such entity with cartid = 0 error only for logged in customer for guest customer its working fine.


texts:
I have setup Magmi several times now with succes. But the latest setup won't handle images. I have it working on a different server. I get the following error.

Image attributes processor v1.0.29 - error copying media/catalog/product/l/a/lat_i6_hx_sl01.jpg : source error,Cannot fetch http://remotedomain.com/_files/products/large/LAT_I6_HX_SL01.jpg :No URL set!

I changed the domain to mask it.

The URL does have an image. I can open it in my browser. On the other server the same product does get images imported. It seems like some sort of a permission issue. The media is recursivly set to 777.


texts: How much time takes to migrate from Magento CE to Magento EE?

texts:
I have a Magento CE live site with some 10 modules and 15 third party modules and now I want to migrate to EE edition.

Can anyone tell me how much approx time it will takes and step of how to migrate to EE?


texts:
As part of a tutorial, I've been asked to overwrite the getCustomerName() function in Mage_Customer_Helper_Data

I have already created the override class, a etc file to make my module active, and a config file to point to the overwrite file:

/etc/modules/Skit_Customer.xml :

<config>
    <modules>
        <Skit>
            <active>true</active>
            <codePool>local</codePool>
        </Skit>
    </modules>
</config>

code/local/Skit/Customer/etc/config.xml :

<config>
    <global>
        <helpers>
            <customer>
                <rewrite>
                    <data>Skytiger_Customer_Helper_Data</data>
                </rewrite>
            </customer>
        </helpers>
    </global>
</config>

code/local/Skit/Customer/Helper/Data.php :

<?php
class Skytiger_Customer_Helper_Data extends Mage_Customer_Helper_Data
{
    /**
     * Overridden function
     *
     * @return string
     */
    public function getCustomerName()
    {
        echo ucwords($this->getCustomer()->getName());
    }
}

I have already confirmed that Magento is picking up my overridden function and using it(I put a die(__CLASS__) in it. What I want to do now is make sure that my function actually works the way I intended it to (It needs to return the customer's name as all capitals).

Looking at my code, I can see that there shouldn't be any problems, but I would still like to actually test it.

I couldn't find where on the front or back end this function was being called, so when I tested it I made a test.php file in the webserver root:

<?php

require_once 'app/Mage.php';

Mage::app();

$customerModel = Mage::getModel('customer/customer')->load(2);
$customerHelper = Mage::helper('customer');
$customerHelper->getCustomerName();

This works just fine when testing with a die();, but I want to test it with an actual customer. I do not know how to make the test.php file, or my overridden file, think that there is a customer.

Could anyone please help me figure this out, or at least point me in the right direction?

I wouldn't mind checking it out on the front/back -end, wherever it is called, but I also would really like to know how to create an instance of a customer that I can test with, as it will most likely come in handy in the future.


texts: Programmatically create cart for guest user

texts:
I have been trying to create cart for guest users. But when i create cart grand_total,sub_total, and item price fields are not being updated. Those fields have 0.00 in quote table.

This is the code i have been using to create cart.

    $productModel = Mage::getModel('catalog/product');
    $product=$productModel->load($productId)->setStoreId($store);

           $quote_obj  = Mage::getModel('sales/quote')->setStoreId($store);

            $param = array(
            'product' => $product->getId(),
            'qty' => $qty,
        );
            $request    = new Varien_Object();
            $request->setData($param);

            try{
                $quote_obj->addProduct($product, $request);
                $quote_obj->collectTotals()->save();

            }
            catch(Exception $e)
            {
                $this->_critical("Product can't be added to shopping cart",Mage_Api2_Model_Server::HTTP_BAD_REQUEST);
            }

I have no idea why this code is not setting grand_total or item price. Any help will be appreciated.

I tried this : Programmatically add items to cart and assign to guest user

But this also not setting the grand total or any other prices.

My quote table


texts: multi merchant site on same magento 2 installation

texts:
I have 4 different clients who has the same requirement(modules/custom functionality) with different themes. I know we can achieve frontend using multi-website.

Can we have different admin logins with permission to access only their own website data(sales/product/category/discounts/etc)?

Are there any other restriction for going one magento + multi-website for different clients?


texts: Magento 2 Additional template to Widget "Catalog products list"

texts:
I am trying to find way to add additional template into "Catalog products list" widget. I can do this from inside vendor but its not a good practice to do it. How to do this without changing anything on vendor folder. Should i need to build custom module link its mentioned here in article to add new custom widget
https://store.magenest.com/blog/how-to-create-custom-widget-magento-2/
Or is their other way to add additional template to existing widget "Catalog products list"
Right now default template and path can be overide by moving file into this path
<Vendor>/<YourTheme>/Magento_CatalogWidget/templates/product/widget/content/grid.phtml

if i need to add additional template, how will i do this.


texts: Magento 1.8 : Import product for store view

texts:
I have two csv files. One for english store view, and one for french. French store is my default store.  I have wanted import csv files separately, but when I imported second csv for english, it overrided default data.
Csv files have this appearance.

sku,description,coul_type,_attribute_set,_product_websites,name,price,short_description,status,visibility,_type,tax_class_id
5053,Convertisseur 700 mA,,Accessories,base,5053,0,Convertisseur 700 mA,1,1,simple,0

sku,description,coul_type,_store,name,short_description
5053,700 mA converter,,en,5053,700 mA converter


texts: Set product attribute "comment" from backend

texts:
No time for coding actually, so I just want to ask if maybe someone already has a working solution (w/o rewrites) :)

I just want to add a text input field to "edit product attribute" page, that show "comment" value for this attribute (that is displayed below input ... like char limits for meta-attributes).

Thanks.

(I'd use it for M1 & M2, but one solution would be fine)


texts: How to copy costumers and orders into development system?

texts:
We copied our shop into a development system and made some big changes. Now we are tested everything and would like to update the database with the latest changes from the live system (costumers and orders) so we would switch live and development system. As we made changes to CMS and configuration we can not switch the whole database.

Who can we copy orders and customers from shop to shop?

Update

I found a blog describing this can be done by copying the listed db tables. But as far as I know directly accessing the database is bad. Would this work or is there are better way?


texts:
I want to upgrade magento from 1.9.2.1 to 1.9.3.1

Can I upgrade to 1.9.3.1 in one go by selecting "upgrade to 1.9.3.1" or shoud I upgrade incrementially (1.9.2.2, 1.9.2.3,1.9.2.4, 1.9.3.0, 1.9.3.0 and finally 1.9.3.1) ?

Thanks


texts: Can't cancel an order on Magento 2 after Stripe automatically refunded an authorization after 7 days

texts:
Just as the title says i have a Magento 2 store. I'm using Stripe as payment gateway. A customer placed an order and i only did the authorization and didn't capture payment. Stripe automatically refunds all authorizations after 7 days of no capture. Now, when i try to Cancel the order i get an error saying "You have not canceled the item.".
In my exception log i see the following:
main.CRITICAL: This order has already been refunded in Stripe. To refund from Magento, please refund it offline. {"exception":"[object] (Exception(code: 0): This order has already been refunded in Stripe. To refund from Magento, please refund it offline. at /home/public_html/vendor/stripe/module-payments/Model/PaymentMethod.php:305)"} []


texts: Why isn't cron creating a log even though it is enabled?

texts:
The emails on my site are not working so I want to take a look at the Cron log to see what the problem is. It is enabled in configuration and there is a string of code in the cron.php file which should create the log but it isn't happening.

Are there any other files relating to cron that need to be adjusted?

Any help is much appreciated?


texts: The correct way to modify core code - need clarification

texts:
I'm preparing my installation of 1.8 to upgrade to the latest. Over the past year I've had a few different developers assist me and even though I ask them not to modify core code, some do anyway.

I've done a search for any files modified past the installation date and have come across a few that need to be preserved.

Question

If file /code/core/Mage/CatalogSearch/Block/Result.php has been modified, my understanding is that to protect this from the upgrade I need to move it /code/local/Mage/CatalogSearch/Block/Result.php ?

Is moving modified core code to the /app/code/local the correct way to protect modified files from upgrades?


texts:
ERROR -   Incompatible argument type: Required type:
\Magento\Directory\Model\CountryFactory. Actual type: array; File:
Magento2/app/code/Vendor/Module/Model/Api/Nvp.php

Original file - /Magento2/vendor/magento/module-paypal/Model/Api/Nvp.php
public function __construct(
        \Magento\Customer\Helper\Address $customerAddress,
        \Psr\Log\LoggerInterface $logger,
        Logger $customLogger,
        \Magento\Framework\Locale\ResolverInterface $localeResolver,
        \Magento\Directory\Model\RegionFactory $regionFactory,
        \Magento\Directory\Model\CountryFactory $countryFactory,
        \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory,
        \Magento\Framework\Exception\LocalizedExceptionFactory $frameworkExceptionFactory,
        \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
        array $data = []
    ) {
        parent::__construct($customerAddress, $logger, $customLogger, $localeResolver, $regionFactory, $data);
        $this->_countryFactory = $countryFactory;
        $this->_processableExceptionFactory = $processableExceptionFactory;
        $this->_frameworkExceptionFactory = $frameworkExceptionFactory;
        $this->_curlFactory = $curlFactory;
    }

Override file - Magento2/app/code/Vendor/Module/Model/Api/Nvp.php
public function __construct(
        \Magento\Customer\Helper\Address $customerAddress,
        \Psr\Log\LoggerInterface $logger,
        Logger $customLogger,
        \Magento\Framework\Locale\ResolverInterface $localeResolver,
        \Magento\Directory\Model\RegionFactory $regionFactory,
        \Magento\Directory\Model\CountryFactory $countryFactory,
        \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory,
        \Magento\Framework\Exception\LocalizedExceptionFactory $frameworkExceptionFactory,
        \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
        array $data = []
    ) {
        parent::__construct($customerAddress, $logger, $customLogger, $localeResolver, $regionFactory, $data);
        $this->_countryFactory              = $countryFactory;
        $this->_processableExceptionFactory = $processableExceptionFactory;
        $this->_frameworkExceptionFactory   = $frameworkExceptionFactory;
        $this->_curlFactory                 = $curlFactory;
    }


texts: What causes an indexer to get marked as "Scheduled" in EE

texts:
Something causes my Solr search index to drop and slowly reindex over and over throughout the day making products disappear.

If the Magento indexer is running on every cron run, how does it decide to mark an indexer as "scheduled" even though my Index Management settings are set to "Update on Save" for search.

Seems to be based on the changelog. Is there a magic number of changelog entries in catalogsearch_fulltext_cl that triggers the scheduling? It's not any sort of event that i can tell. Nothing i edit and save triggers the schedule; it just seems to happen randomly.


texts: How to handle multiple tables with magento 2 repositories?

texts:
As we all know, magento 2 suggests using repositories as an additional layer between resource models/collections and the rest of application. It's all pretty straightforward and simple when you use it for single tables. Majority of multi-table query results are obtained in magento 2 sourcecode using collections instead of repositories. I suppose that it's an inconrect way, as for instance extension attributes (which are recommended to be plugged only to repositories) won't load with those collections.

So my question is: what's the official recommended way to handle multi-table source of data in repositories?

Some ways that come to my mind are:

always join all possibly required tables (obviously terrible performance)
additional repositories/methods for every set of required joins (lots of redundant code and additional plugining when you use mechanisms such us extension attributes)
ignore repositories and use raw collections (additional plugins for mechanism such us extension attributes)
'lazy' join additional tables to collections inside repositories when certain predefined fields are in filters (unobvious usage, dirty code I would say).

But none of solutions above looks reasonable to me.


texts: Magento 2: is there any way to update cart product price on cart and checkout page load?

texts:
Can i use any event for update my cart product price while reload cart and checkout page ?

any idea please share..


texts:
I have a phtml file that displays/echo's a block of HTML code that I wish to place onto the product page of my website.

basically, I'd like to add this piece of code to the view.phtml:

echo $this->getChildHtml('product_categories');

The fileself resides in catalog/product/categories.phtml - and needs to access $this->getProduct(); in order to do it's "coding".

I understand that my phtml file needs to reside inside of the skin that I created - and I have done that.  How can I setup/tell magento that 'my_data' is a block or phtml file that resides in where I put it, so that it get's executed?

Thank you


texts: Magento 2 How to Catalog Price rule apply on product special price

texts:
i want to catalog price rule apply on special price product but i see in magento default apply only on product final price

but i want to catalog rule apply on product special price

how can achieve this? anyone help me on this case

Any help would be appreciated.

Thanks.


texts: How To Remove Images From Database using Image Path?

texts:
I need to remove images from database by using image path,

Paths:  m/1/m1.jpg, n/2/n2.jpg

Eg: www.abc.com/media/catalog/product/m/1/m1.jpg

my images located at media/catalog/product/5/2/53765.jpg, how can i remove, and large no.of images are located various location i know every image path location, how can i bulk remove?


texts: Virtual host setup in localhost using Docker on Ubuntu. magento 2

texts: I'm trying to convert http://localhost/magento231/ to http://testing.com and for admin http://testing.com/admin I followed https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts but it was not useful for me. How can I change my Visual Host?


texts:
I have phtml form, whenever i get any error it shows a page like this

i want to show these type of errors like this


texts: What is the meaning of "*" in magento custom jQuery

texts:
I have a code of jQuery:

    <script type="text/x-magento-init">
        {
            "*": {
                "magepowSizeGuide":{}
            }
        }
    </script>

What can be the meaning of * ?

Is this mean that this jQuery will work on all HTML element ?


texts: How we can create partial shipment programmatically using rest api

texts: I can successfully create the shipment for the entire order but if I want to create partial shipment then it will also create the full quantity can someone tell me how can I create the partial shipment.


texts: Enterprise 1.14.1 Swatches causing 35 sec plus load time on category pages

texts:
We have implemented the new inbuilt Swatches feature in our latest new site build When we enable the swatches on category pages the page load time goes from 2 seconds to 38 + seconds.

I was wondering if anyone else had had this issue and if so could give us an indication of any possible solutions?

We have tried EE 1.14.1 and CE 1.9.1 with 36 configurable products with swatches applied on the standard rwd theme and no other modules active.

This issue can't be resolved by caching as every time a user searches or filters a category the page grinds to a halt again.


texts: Magento 2.2.5 Category admin stuck after thumbnail image upload

texts:
I've just tried to upload a thumbnail image to a category, when pressing save, the washed-out loading screen appears and never goes away.  If I back out of that page and then try and go back, the loading screen is still there.  Logging out, quitting the browsers doesn't seem to make any difference.  The category is now uneditable in the admin.

This was a migrated site, and first time I've checked thumbnails - the rest of the migration was perfect.

This is the exact issue, but no answers...
Uncaught TypeError: value.map is not a function coming from file-uploader.js
Please help!


texts: How to add a product block to the magento 1.9 noItems.phtml page?

texts:
I'm trying to add product blocks to the noitems [your cart is empty] page in magento 1.9
I kind of figured it would be something like:

<checkout_cart_noItems>

     <reference name="content">

          <block>whatever</block>

     </reference>

</checkout_cart_noItems>

But it's not, comparing to the default checkout.xml layout file I see that a template is set:

<action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>

How can I add my product blocks to the noItems.phtml file in my local.xml?


texts: Get firstname and lastname contact page Magento 1.9

texts:
I want to get the first and last name in a custom contact form in Magento 1.9.x

in my custom_contact.phtml  file I have this:

<?php

if (Mage::getSingleton('customer/session')->isLoggedIn()) {
    // Get the customer object from customer session
    $customer = Mage::getSingleton('customer/session')->getCustomer();

    $custID = $customer->getID();//get customer id
    $custFirstName = $customer->getFirstname();
    $custLastName = $customer->getLastname();
    $custEmail = $customer->getEmail();//get customer email
}

?>

                    *<?php echo Mage::helper('contacts')->__('First Name') ?>

                        <input type="text" name="xcustom" id="xcustom" value="" style="display:none !important;" />
                        <input name="xfirstname" id="xfirstname" title="<?php echo Mage::helper('contacts')->__('First Name') ?>" value="<?php echo $custFirstName ?>" class="input-text required-entry" type="text" />

                    *<?php echo Mage::helper('contacts')->__('Last Name') ?>

                        <input name="xlastname" id="xlastname" title="<?php echo Mage::helper('contacts')->__('Last Name') ?>" value="<?php echo $custLastName ?>" class="input-text required-entry" type="text" />

and I add this conditions in the transactional email:

{{if xcustom}}First Name: {{var customer.xfirstname}}{{else}}{{/if}}
{{if xcustom}}First Name: {{var customer.xlastname}}{{else}}{{/if}}

Name: {{var data.name}}
Email: {{var data.email}}
Telephone: {{var data.telephone}}

Comment: {{var data.comment}}

but Firsname and Lastname content not exist in my email. Can someone help me?


texts: Canadian SHipping is coming up free when I did not set it up that way?

texts: For some reason all our Caniadian sales are getting free shipping USPS priority Mail when we did not set this up? They get a charge for Express Mail but Priority mail shows $0. What could cause this?


texts: How to disable tier pricing for a special promotion?

texts: Is there a way we can disable tier prices for a weekend promotion? I need to offer 30% discount for the entire store, but tier prices make it so hard. Actually I'm removing tier prices by product each one. After the promotion I need to load each product and set the tier price again.


texts:
So I created magento shop which already have products, customers, some orders. Now I would like to move it to amazon aws hosting. I made database dump to import all data that I have but I faced problem: I am not getting correct path when I imported my database.

For example instead of myshop.amazonaws.com/magento/js/varien/form.js

I getting url like this:

myshop.amazonaws.com/opt/bitnami/apps/magento/htdocs/js/varien/form.js.

I checked httpd-prefix.conf file and it looks ok for me:

Alias /magento/ "/opt/bitnami/apps/magento/htdocs/"
Alias /magento "/opt/bitnami/apps/magento/htdocs"

Does anyone have experience using amazon aws hosting for magento ?


texts: How do I add data (that's not in a table) to my collection?

texts:
Specifically, in my adminhtml Grid.php I created a $collection in _prepareCollection() by using the getSelect()->join() and it works great. I've merged several tables.

Now I want to create a custom column that includes a value based on sku. Lets call it product type. I would like to do something like this:

    foreach($collection as $item):
        if($item->getSku() == 'fresh')
            $item->setData('product_material','Fresh');
        else
            $item->setData('product_material','Not Fresh');
        $item->save();
    endforeach;

I have more complex logic to build the product material, but you should get the point. The fact I found no clue on how to do this also tells me I'm probably approaching this incorrectly. Is there a better way to do this or a place to handle this?

I don't want to store this in a table yet because we are still defining what inputs generate the material type.


texts: Cron Job doesnt start when DeploymentConfig in __construct parameter

texts:
i have one Problem that i cant understand. I have a Cronjob that should read in the Env.php via DeploymentConfig. When i add DeploymentConfig in the Job __construct, the Job wont start.

Doesnt start:

public function __construct(
    Context $context,
    MarketCollectionFactory $marketCollectionFactory,
    MarketFactory $marketFactory,
    SynchronizableFactory $modelFactory,
    ResourceConnection $resourceConnection,
    array $data = [],
    DeploymentConfig $deploymentConfig
) {
        ~~~
}

Does start:

public function __construct(
    Context $context,
    MarketCollectionFactory $marketCollectionFactory,
    MarketFactory $marketFactory,
    SynchronizableFactory $modelFactory,
    ResourceConnection $resourceConnection,
    array $data = []
) {
        ~~~
}

Could it be, that i cant inject it in Cron Jobs. If yes, is there an other way to access the env.php?

Greetings

Edit:

Here is the full file:

namespace Addons\Markets\cron;
use Addons\Markets\Block\Markets;
use \Magento\Framework\View\Element\Template\Context;
use \Addons\Markets\Model\ResourceModel\Markets\CollectionFactory as MarketCollectionFactory;
use \Addons\Markets\Model\MarketFactory as MarketFactory;
use \Addons\Synchronizer\Model\SynchronizableFactory;
use Magento\Framework\App\ResourceConnection;
use \Magento\Framework\App\DeploymentConfig;

use \Zend\Log\Writer\Stream;
use \Zend\Log\Logger;

class Job
{

private $market;

public function __construct(
    Context $context,
    MarketCollectionFactory $marketCollectionFactory,
    MarketFactory $marketFactory,
    SynchronizableFactory $modelFactory,
    ResourceConnection $resourceConnection,
    array $data = [],
    DeploymentConfig $deploymentConfig
) {
        $this->market = new Markets(
        $context,
        $marketCollectionFactory,
        $marketFactory,
        $modelFactory,
        $resourceConnection,
        $data,
        $deploymentConfig);
}

public function execute()
{
    $writer = new Stream(BP . '/var/log/cron.log');
    $logger = new Logger();
    $logger->addWriter($writer);
    $logger->info('Job Started');
    $this->market->synchronize();
}
}


texts:
I have block definition in cms page

{{block type="divante_cdp/homeblog"}}

And construct method of my block

public function __construct(array $args = array())
{
    $this->setTemplate('page/html/homeblog.phtml');
    $this->addData(array(
            'cache_lifetime' => 3600,
            'cache_tags'     => array(Mage_Cms_Model_Block::CACHE_TAG,'tag_home_homeblog'),
        ));

    parent::__construct($args);
}

Block isn't cached. After run below command there is no tag tag_home_homeblog

n98-magerun.phar cache:report -t

What i'm doing wrong? Cache is enabled :)


texts: Phishing Attack - Magento 1.9 - Too many Get method request for customer login page - Site Down

texts:
The IP : 167.172.230.190 hit my customer login page too many hits makes my server down
Screenshot : https://snipboard.io/kde4fw.jpg
Notes : Custom login page captcha enabled, added that IP in IP Blocker from Cpanel as well as added Godaddy firewall also still the attack continues...
Any help thanks.


texts: Magento 2: Refresh Statistics Automatically On Page Load Or via Cron Job

texts:
When ever we see any Admin Report, Every time need to click & update "Refresh Statistics".

  For accurate reporting, be sure to refresh lifetime statistics
  whenever you change the time zone. Last updated: Nov 21, 2016, 9:06:37
  PM. To refresh last day's statistics, click here.

I would like to do it Automatically. So whenever data changed Statistics update Automatically.


texts: Magento 2 : addAttachment is not working

texts:
I was lots of tries to send the attachment to mail but no luck. Please check my below code and please correct me where I am wrong.

<?php
/**
 * KiwiCommerce
 *
 * Do not edit or add to this file if you wish to upgrade to newer versions in the future.
 * If you wish to customize this module for your needs.
 * Please contact us https://kiwicommerce.co.uk/contacts.
 *
 * @category   KiwiCommerce
 * @package    KiwiCommerce_AdminActivity
 * @copyright  Copyright (C) 2018 Kiwi Commerce Ltd (https://kiwicommerce.co.uk/)
 * @license    https://kiwicommerce.co.uk/magento2-extension-license/
 */
namespace KiwiCommerce\AdminActivity\Cron;

use Magento\Framework\App\RequestInterface;

/**
 * Class ClearLog
 * @package KiwiCommerce\AdminActivity\Cron
 */
class Test extends \Magento\Framework\App\Action\Action
{
  /**
     * @var \Magento\Framework\App\Request\Http
     */
    protected $_request;
    /**
     * @var \Magento\Framework\Mail\Template\TransportBuilder
     */
    protected $_transportBuilder;
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\App\Request\Http $request,
        \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    )
    {
        $this->_request = $request;
        $this->_transportBuilder = $transportBuilder;
        $this->_storeManager = $storeManager;
        parent::__construct($context);
    }

    public function execute()
    {
        $filePath = 'C:/new/xampp/htdocs/Uplifting-Products/var/export/Adminactivity/admin_activity_09_11_2019_14_35_49.csv';

        $fileName = 'admin_activity_09_11_2019_14_35_49.csv';

        $store = $this->_storeManager->getStore()->getId();
        $transport = $this->_transportBuilder->setTemplateIdentifier('modulename_test_template')
            ->setTemplateOptions(['area' => 'frontend', 'store' => $store])
            ->setTemplateVars(
                [
                    'store' => $this->_storeManager->getStore(),
                ]
            )
            ->setFrom('general')
            // you can config general email address in Store -> Configuration -> General -> Store Email Addresses
            ->addTo('gagaugaugaug@gmail.com', 'Customer Name')
            ->addAttachment($filePath,$fileName)
            ->getTransport();
        $transport->sendMessage();
        return $this;
    }
}

Also i have completed the below process after run above code.

To add an attachment programmatically in the email, first, you need to override \Magento\Framework\Mail\Template\TransportBuilder class.

  Step 1: app/code/[Namespace]/[Module]/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="\Magento\Framework\Mail\Template\TransportBuilder" type="\[Namespace]\[Module]\Mail\Template\TransportBuilder" />
</config>
Step 2: app/code/[Namespace]/[Module]/Mail/Template/TransportBuilder.php

<?php

namespace [Namespace]\[Module]\Mail\Template;

class TransportBuilder extends \Magento\Framework\Mail\Template\TransportBuilder {

    public function addAttachment(
    $filePath, $filename = null, $mimeType = \Zend_Mime::TYPE_OCTETSTREAM, $disposition = \Zend_Mime::DISPOSITION_ATTACHMENT, $encoding = \Zend_Mime::ENCODING_BASE64
    ) {
        if (file_exists($filePath)) {
            $body = file_get_contents($filePath);
            $this->message->createAttachment($body, $mimeType, $disposition, $encoding, $filename);
        }
        return $this;
    }

}

Now, you can call addAttachment() function while sending an email.

Note: addAttachment function requires 2 parameters: filePath and fileName.


texts:
I want to change the image path (even stylesheet background image url) with  .htaccess,
My Magento site gets all images from production site in local server,


texts: Product page sometimes displays 404/links to home

texts:
I'm running 1.9.2.1 with the latest security patches installed. When visiting a product page, sometimes (1 in 100 or something?) it displays a 404 error. When refreshing the page, it'll display correctly. Even less often it just links to the homepage. When navigating back to the catalog and clicking the product again, it works correctly.

I can't reproduce the problem and there's nothing special in the logs as well. Any advice how to debug this problem? Thanks!


texts: Magento2 can't inject dependency in Class which extends from \Magento\Catalog\Block\Product\ListProduct

texts:
I'm trying to extend a Block in Magento, the Magento\Catalog\Block\Product\ListProduct block and Inject a dependency on it, but I've hit a wall and just get this error.

Fatal error: Uncaught TypeError: Argument 2 passed to Holy\Demo\Block\Product\ListProduct::__construct() must implement interface Magento\CatalogInventory\Api\StockStateInterface, instance of Magento\Framework\Data\Helper\PostHelper given, called in /var/www/html/generated/code/Holy/Demo/Block/Product/ListProduct/Interceptor.php on line 14 and defined in /var/www/html/app/code/Holy/Demo/Block/Product/ListProduct.php:14 Stack trace: #0 /var/www/html/generated/code/Holy/Demo/Block/Product/ListProduct/Interceptor.php(14): Holy\Demo\Block\Product\ListProduct->__construct(Object(Magento\Catalog\Block\Product\Context), Object(Magento\Framework\Data\Helper\PostHelper), Object(Magento\Catalog\Model\Layer\Resolver), Object(Magento\Catalog\Model\CategoryRepository\Interceptor), Object(Magento\Framework\Url\Helper\Data), Array) #1 /var/www/html/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(111): Holy\Demo\Block\Product\ListProduct\Inte in /var/www/html/app/code/Holy/Demo/Block/Product/ListProduct.php on line 14

This is the di.xml of my module:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Product\ListProduct" type="Holy\Demo\Block\Product\ListProduct" />
</config>

And this is my Block class:

<?php

namespace Holy\Demo\Block\Product;

/**
 * Product list
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{
    /**
     * @param \Magento\CatalogInventory\Api\StockStateInterface $stockState
     */
   public function __construct(
       \Magento\Catalog\Block\Product\Context $context,
//        \Magento\Backend\Block\Template\Context $context,
       \Magento\CatalogInventory\Api\StockStateInterface $stockState,
       array $data = []
   )
   {
       $this->stockState = $stockState;
       parent::__construct($context, $data);
   }

    public function getStockQty($product) {
      // TODO: Don't use objectManager, Inject the \Magento\CatalogInventory\Api\StockStateInterface on the constructor of the block
      // $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      // $_stockState = $_objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
      // return $_stockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId());

       return $this->stockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId());
    }
}

UPDATE

I was able to get it working by adding all of the parent class arguments from it's constructor to my constructor, but this does not seem like a good approach to me as  if in a Magento update a new dependency is added to the parent class, won't that break my module?

public function __construct(
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
    \Magento\Catalog\Model\Layer\Resolver $layerResolver,
    \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
    \Magento\Framework\Url\Helper\Data $urlHelper,
    \Magento\CatalogInventory\Api\StockStateInterface $stockState,
    array $data = []
)
{
    $this->stockState = $stockState;
    parent::__construct($context, $postDataHelper , $layerResolver, $categoryRepository, $urlHelper, $data);
}


texts: Magento 2.3 Force Shipping for Downloadable Products

texts:
Here is my problem:

I have some books products, and they can be sold digital or printed. But if the customer buys the printed version they MUST get the digital content too.

How can I get that?

I try creating a bundle, with 2 downloadable products, but in that case, I don't get the shipment or a downloadable and simple that in that case, I lost the logic of the link.


texts: Magento and Wordpress in two different servers, same domain

texts:
I have a ecommerce in Magento: ecommerceshop.com (example) and i create a wordpress  blog to this ecommerce.

I have two different servers:

ecommerceshop.com in AWS

blog.ecommerceshop.com (Blog) in Digital Ocean

In SEO issues, isn't a good idea because it doesn't give any relevance, correct?

I need an idea to make my blog as if it were a folder in AWS (tunnel?), but in the Digital Ocean server, for security reasons.

Result:

ecommerceshop.com/blog

ecommerceshop.com/blog/7-things-to-do/

Possibly useful points:

- I'm using NGINX on both servers

UPDATED - SERVER BLOCKS:

blog.ecommerceshop.com server block (Digital Ocean)

server {
    listen blog.ecommerceshop.com:80;
    root /usr/share/nginx/html;
    index index.php index.html index.htm;
    server_name blog.ecommerceshop.com;
    include /etc/nginx/security.nginx;
    location / {
        try_files $uri $uri/ /index.php?q=$uri&args;
    }
    error_page 404 /404.html;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

ecommerceshop.com server block (AWS)

server {
    listen 8082;
    root /mnt/www/sites/ecommerceshop;
    index index.php;
    server_name www.ecommerceshop.com;
    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; }
        add_header X-Cache $upstream_cache_status;
        expires off; ## Do not cache dynamic content
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_TYPE website;
        fastcgi_param MAGE_RUN_CODE base;
        include fastcgi_params; ## See /etc/nginx/fastcgi_params
    }
}


texts: I don't see app/code folder even after creating my custom theme. Should I need to create it manually?

texts:
I have downloaded Magento 2 community edition from Magento site. I wanted to add a free Magento banner slide extension from https://github.com/Magestore/Bannerslider-Magento2

In the description given in this link, I need to add the folder to app/code folder. What should I do otherwise..?? In many other tutorials, I find asking me to add files or modify the contents of app/code. Please give me a suggestion I am very new to Magento 2


texts:
I need to disable all customer account related pages, like Account info, Edit addresses, change password for customers of a specific Magento store. Basically I want the customers on that specific store, to just login, register, view products and buy the same only.

And I also do not want to send any welcome email to customers who register on this store.

I tried to find the solution, but could only find solutions to hide the links, but some customers might end up opening them directly.


texts: How to add an icon in my extension tab on the admin panel in Magento 2?

texts:
I'd like to add an icon like this image below, my custom module creates a new tab on this same route Stores > Settings > Configuration.

So how can I add an icon like that red?

Thanks


texts: Flipper image not working in Magento 2.3.3

texts:
Have anybody tried using flipper image in magento 2.3.3. I tried selecting flipper image option for one image but it is not working. https://prnt.sc/v9trt5
Can any body help


texts: How to show product category description below list of products bottom of page?

texts: I am trying to add category description on listing page on under pagination bar.


texts: Can Magento 1.9 be configured to load product images directly from an external URL:

texts: Is there any way to load images directly from external url, instead of importing images in to the server?


texts: Where i can get free multi vendor module for magento 2.3.5 version?

texts: I would like to know if you guys know there is any website which provides modules free for magento 2 especially multi vendor.


texts: Magento websites on subdomain while main site is already on subdomain

texts:
I have a magento setup on a subdomain ( shop.mysite.com ) and now I want to add multiple sites and configure them on subdomain like uk.mysite.com and in.mysite.com.

Is it possible ?

I tried it but all websites/stores loading same products even if they have been added for another store.

Issue is different because my site (main site) is already on subdomain.


texts: Tierprices in product view - wrong price calculation

texts:
I have a problem with the view of the tier prices. When customer group ID X have tier price for 6 pieces each 56,--. The view show this:

  The tierprices for all:

6 pieces each 64,--
12 pieces each 61,--

In this case the tier price view should only show the 6 pieces.
Where is the problem?


texts:
I am using the layout handle customer_account to add CSS to the account pages like this:

<customer_account>
    <reference name="head">
        <action method="addCss">
            <name>css/parts/account.css</name>
        </action>
    </reference>
</customer_account>

But it seems that this CSS is not added to the forgot password page, while it does have the same type of url as the other account pages: domain.com/customer/account/forgotpassword/

My question: What is the layout handle for this page, or is there a way to add this page to the customer account handle?


texts: Is magento model load do select for update

texts:
I want to load a model and for update
equivalent sql :

START TRANSACTION;
SELECT * FROM table WHERE id = 'id' FOR UPDATE;
COMMIT;

May magento model have the same method ?


texts: create order - adding products from admin - ordering logic

texts:
What is ordering logic when you add a product from admin.
Sales -> Order -> Create New order -> Choose Customer -> Add Products

If you search by product ID and choose product and after you search for another product and choose. Press "Add selected products to Order".

The ordering of the products is not in order as I added. The order is by IDs. So the smallest is first and biggest last. If we can change it by time the tick box is clicked.

i think the code is in this file

app/design/adminhtml/default/default/template/sales/items/column/name.phtml

Does somebody know where to change the logic?

The only working solution is when you search for product and press "Add selected products to Order". after you search for another product again and press "Add selected products to Order". Then the order is fine.

I know its strange question. but one my client wants this. I dont know how to google it at all and where to dig.


texts:
I'm trying to assign a product to a number of categories programmatically. I'm using this code to do so :

$arrayofCategories = array($Id1,$Id2);
$product->setCategoryIds($arrayofCategories);

Note that i'm using that same $product to set others attributes and they were set properly but when i check the product in backend in its categories section, none of the categories with the ids in the array is checked.

Is this the right syntax ?


texts: Magento 2: Conditionally process layout XML file

texts:
I have an XML layout file, specifically customer_account_login.xml, which is processed automatically by Magento and replaces the out-of-the-box copy.

In some cases I would like to do this, while in others I want the out-of-the-box file (based on backend configuration).

I have not found a way to turn off processing for my XML file under certain conditions, but assume there is some class that can be overridden to do this. A generic way would be preferable, but I could live with a method that toggles just this specific XML file.

To clarify: the question is about avoiding processing the XML file entirely, not how to conditionally show/hide certain blocks and other layout elements.


texts:
How can I customise the comparison PDF of Magento 2.1 PDF invoice layout?

I want to change the content of comparaison pdf (format) in magento 2.1

I want to remove header and footer section from pdf format and href links.


texts: Magento 2.2.6 Search only search from starting word

texts:
i am facing issue with magento 2.2.6 Search there is some products number in my website
e.g 30330, 303090, 30901, 450905 etc
when i enter 303 in my search the result show up correctly but when i enter 090 in the search bar ther result show up with this "Your search returned no results" how can i solve this issue also how can i do my search in ascoding order
thanks


texts: Can a product have 2 different stock status?

texts:
I would got a use case whereby stock is differentiated into own stock and consignment stock.

Consignment stock will only be sellable once the owned stocked is all sold.

Is there a way to implement this? Basically, I want to differentiate the 2 product code or stock for 1 product.

Looking to hear from you!


texts:
Upgrading from Magento 2.1.7 to 2.2.0
PHP 7.0
MySQL 5.6

Through command line I've run these commands and had no hiccups until I looked at the front end:
bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.0 --no-update
composer update
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/generation/*
chmod +x bin/magento
bin/magento setup:upgrade
bin/magento maintenance:disable

I get this error message, I'm new to Magento and just an ecommerce manager, I'm updating due to some vulenrabilities, if anyone can help it would be great:

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected.
Line: 721

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected.
Line: 721


texts: Magento how to get the same style and layout of customer dashboard for my custom field

texts:
I am adding a custom field to customer account dashboard and here I want to display the order as it is displaying on the my order thing and I have to add some buttons and a submit form. So my question is how I will get the layout of my orders for my custom filed.

I have added custom field using this link
go the link and check the process.


texts: How do you manage dev/tools/grunt/configs/themes.js file with version control in magento2?

texts:
The themes.js file contains important configuration and without it you cannot run grunt tasks for your theme:

#dev/tools/grunt/configs/themes.js
mytheme: {
        area: 'frontend',
        name: 'Package/mytheme',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    },

This is why we track that file with git.

The issue is that every time I update magento2 to a new version, like from 2.0.5 to 2.0.6, that file gets reset to its default contents, so my theme configuration is lost. I have to go back in the repo and recommit that file.

Any solution? Do you track that file?

Thanks!


texts: How to removed mini cart picture with the width and height

texts:
I need to remove the width and height of the picture in mini-cart pages. I have checked about Magento developer document. I realize I can set up in view.xml to change the width and height, but here is the problem while I configure the width and the height in the view.xml the pic is stretched. I also checked about code (See below code).
It's written by knockout js

    <a class="action showcart" title="<?= $block->escapeHtml(__('My Basket')) ?>" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
   data-bind="scope: 'minicart_content'">

    <?php /* @escapeNotVerified */ echo __('Your Cart'); ?>

Are any solutions that I can remove the width and height in the mini cart page?


texts: collection condition filter = ((condition AND condition) OR (condition AND condition))

texts:
I'm stuck on something, I've look on every results I have found on Google but I haven't found the solution yet.

I'm trying to do a SQL request which look like that:

SELECT `main_table`.*, `order`.`increment_id` AS `order_increment_id`, `order`.`status` AS `order_status` FROM `magentoudropship_po` AS `main_table`
INNER JOIN `magentosales_flat_order` AS `order` ON main_table.order_id=order.entity_id
WHERE ((main_table.udropship_status = 0 AND main_table.created_at > '22/04/2015') OR (main_table.udropship_status = 9 AND main_table.created_at > '20/04/2015'))

I haven't found how to insert an AND condition inside a OR condition ...

Here's my actual code:

$collection = Mage::getModel('udpo/po')->getCollection()
            ->addFieldToFilter(
                array('main_table.udropship_status', 'main_table.udropship_status'),
                array(array('eq' => Unirgy_DropshipPo_Model_Source::UDPO_STATUS_PENDING), array('eq' => Unirgy_DropshipPo_Model_Source::UDPO_STATUS_ACK))
            );
$collection->getSelect()->join(
            array('order' => Mage::getSingleton('core/resource')->getTableName('sales/order')), 'main_table.order_id=order.entity_id',
            array('order_increment_id' => 'increment_id', 'order_status' => 'status')
        );
$collection->load();

And this is the request I have for now:

SELECT `main_table`.*, `order`.`increment_id` AS `order_increment_id`,  `order`.`status` AS `order_status` FROM `magentoudropship_po` AS `main_table`
INNER JOIN `magentosales_flat_order` AS `order` ON  main_table.order_id=order.entity_id
WHERE ((main_table.udropship_status = 0) OR (main_table.udropship_status = 9))

Do you know how to achieve a condition like ((condition AND condition) OR (condition AND condition)) ?


texts: Magento front and backend suddenly displaying in plain text

texts:
my website is suddenly displaying in plain text, my backend as well. I'm running Magento 1 still. I tried restoring a back up from before the incident happened, nothing changed.
I made sure the ip_config table in my database is not missing any /. I also checked on the css stylesheet link, i do not have any missing / either.
i'm starting to run out of options here, is there anything else i can try to fix this problem?


texts: How to edit the NewProducts block magento

texts: I have a new question. I am trying to remove TAX information from the New Products block from home page but not successful. Can somebody help me with this problem? I dont fine witch file I need to edit to remove this information from this block and Sale Products blcok. Any suggestions are welcomed. Thank you


texts:
Magento 2.1.2 Development Mode.

I want to overwrite the styles of the Luma theme blocks.

I have included the default_head_blocks.xml file in the path:/app/design/frontend/Vendor/mytheme/Magento_Theme/layout
The file has the following code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
<head>
<css src="css/custom.css" />
<css src="css/custom_mobile.css" media="screen and (min-width: 768px)"/>
</head>
</page>

In the path: /app/design/frontend/Vendor/mytheme/web/css I created the custom.css file, and in the file I have included the styles I want to modify,for example:

.womens-category-pants img, .womens-category-tanks img, .womens-category-shorts img, .mens-category-tees img, .mens-category-hoodies img, .mens-category-shorts img, .gear-category-bags img, .gear-category-equipment img, .gear-category-watches img {
max-width: 100% !important;
position: absolute;
z-index: 0;
top: 0;
right: 0;
left: 10%;
}

Then I have executed the following commands:

rm -rf var/generation var/view_preprocessed var/cache var/page_cache
rm -rf pub/static
bin/magento cache:clean
bin/magento cache:flush
php bin/magento setup:static-content:deploy
php  bin/magento setup:static-content:deploy es_ES
bin/magento indexer:reindex

But the styles are not applied, although in the /pub/static/frontend/Vendor/ mytheme/es_ES/css directory the custom.css file is located with the code that I included in that file.

Next I tested including the _sources.less file in the path /app/design/frontend/Vendor/mytheme/web/css and with the following code:

// /**
//  * Copyright Â© 2016 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

@import '_variables.less';
@import (reference) '_extends.less';
@import '_typography.less';
@import '_layout.less';
@import '_tables.less';
@import '_messages.less';
@import '_navigation.less';
@import '_tooltips.less';
@import '_loaders.less';
@import '_forms.less';
@import '_icons.less';
@import '_buttons.less';
@import '_sections.less';
@import '_pages.less'; // Theme pager
@import '_actions-toolbar.less';
@import '_breadcrumbs.less';
@import '_popups.less';
@import '_price.less';
@import (css) 'custom';

I have added the last line taking as reference the documentation of http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/css-topics/css-preprocess.html

I re-executed the commands deleting the directories and displaying static content, but without success.

Can anyone tell me I'm doing wrong?


texts: InStock value does not change for configurable product after simple products has been sold

texts:
I have noticed that after all the simples products get quality 0 their Stock value automatically changes to out of stock. This is the way it is supposed to work in magento. However, I noticed that when I all the simples products have been sold, their stock value goes out of stock, but this value for the configurable product stays in stock. I ma not sure wether this is supposed to work like it. I was trying to find a way to set it to change out of stock as all the simple products get sold.

Is there a way to do it on the back end or do I have to do it programatically?

Magento ver 1.7.0.2


texts:
I have a custom list.phtml file in

  app\design\frontend\BSS\ContactUs\Magento_Catalog\templates\product\list.phtml

And I want to override it on

  \vendor\magento\module-catalog\view\frontend\templates\product\list.phtml

How to make it work?


texts: How to show customer review on magento homepage with rating, customer profile picture?

texts:
I want show customer review on magento homepage with rating, customer profile on my magento 2 store.
What is the best way to do that? Do you have any suggestion. Highly appreciated.


texts: Validation Failed when running bin/magento app:config:import

texts:
I have added the following data to my app/etc/config.php file:

'scopes' => [
    'websites' => [
        'admin' => [
            'website_id' => '0',
            'code' => 'admin',
            'name' => 'Admin',
            'sort_order' => '0',
            'default_group_id' => '0',
            'is_default' => '0'
        ],
        'website_1' => [
            'website_id' => '1',
            'code' => 'website_1',
            'name' => 'website_1',
            'sort_order' => '0',
            'default_group_id' => '1',
            'is_default' => '1'
        ],
        'website_2' => [
            'website_id' => '2',
            'code' => 'website_2',
            'name' => 'website_2',
            'sort_order' => '0',
            'default_group_id' => '2',
            'is_default' => '0'
        ]
    ],
    'groups' => [
        [
            'group_id' => '0',
            'website_id' => '0',
            'name' => 'Default',
            'root_category_id' => '0',
            'default_store_id' => '0',
            'code' => 'default'
        ],
        [
            'group_id' => '1',
            'website_id' => '1',
            'name' => 'group_1',
            'root_category_id' => '2',
            'default_store_id' => '1',
            'code' => 'group_1'
        ],
        [
            'group_id' => '2',
            'website_id' => '2',
            'name' => 'group_2',
            'root_category_id' => '2',
            'default_store_id' => '2',
            'code' => 'group_2'
        ]
    ],
    'stores' => [
        'admin' => [
            'store_id' => '0',
            'code' => 'admin',
            'website_id' => '0',
            'group_id' => '0',
            'name' => 'Admin',
            'sort_order' => '0',
            'is_active' => '1'
        ],
        'en_gb' => [
            'store_id' => '1',
            'code' => 'store_1',
            'website_id' => '1',
            'group_id' => '1',
            'name' => 'store_1',
            'sort_order' => '0',
            'is_active' => '1'
        ],
        'store_2' => [
            'store_id' => '2',
            'code' => 'store_2',
            'website_id' => '2',
            'group_id' => '2',
            'name' => 'store_2',
            'sort_order' => '0',
            'is_active' => '1'
        ]
    ]
]

When running the the following CI command:

php bin/magento app:config:import

I am greeted with the following helpful error message:

$ php bin/magento app:config:import --no-interaction
Processing configurations data from configuration file...
Import failed: Validation Failed

Has anyone come across this issue before know how I can determine why the validation failed?

I've checked the logs and found nothing of use apart from the same super helpful error message repeated.


texts: How to create and update drop down type attribute using SOAP API in Magento?

texts:
I am working on Source Magento to Destination Magento migration.
I have created an attribute like other attributes so that is not the issue but I am having a big issue or say I don't know how to do....that....if drop down type attribute is already there in destination magento then how to know that which options are missing & insert those options only.

I got a very nice solution in Milan's answer here.....  https://stackoverflow.com/questions/32679416/create-a-new-dropdown-select-product-attribute-with-options-in-magento-via-s

What he is doing...creating attribute first & then looping through the options & one by one inserting options in that attribute but here comes the point....that if this attribute is already there in destination magento then how to find that....these....these....options are available in destination magento & we only need to insert these....these....options.

Here is what I am doing to check whether the attribute is already there in destination magento or not....

$check_magento_attribute_already_available_ornot = $dProxy->call($dSessionid,'product_attribute.info',$attribute_code);

This will give true or error & according to that I create or update the attribute.

So finally the questions are 2 :-
1) How to check if options...already there in destination magento's attribute using soap api
2) How to insert that drop down type attribute's value in product at the time of product creation or updation? - Whether to use multi_data or single_data?

Thanks.


texts: Magento 2 join table with elasticsearch enable

texts:
I have an observer that hooked into catalog_block_product_list_collection

        /**
     * @var \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor $collection
     */
    $collection = $observer->getCollection();
    try {
        /*            $collection->joinTable(
                        ['delivery' => 'catalog_category_delivery'],
                        'product_id = entity_id',
                        ['delivery_days'],
                        ['city_id' => $cityId],
                        'left'
                    );*/
        /*$collection->getSelect()->joinLeft(
            ['delivery' => 'catalog_category_delivery'],
            'e.entity_id = delivery.product_id',
            'delivery_days'
        );*/
        $collection->joinField('delivery', 'catalog_category_delivery', 'delivery_days', 'product_id=entity_id',
            "{{table}}.city_id=4", 'left');
    }
    catch (LocalizedException $e) {
        echo $e->getMessage();die;
    }

    foreach($collection as $product) {
        /**
         * @var \Magento\Catalog\Model\Product\Interceptor $product
         */
        echo $product->getName() . '
';
        echo $product->getId() . '
';
        var_dump($product->getData('delivery_days'));
        echo '
';
    }

    die;

The problem is, $product->getData('delivery_days') is empty. If I debug the query sql string and run directly in mysql, I get the delivery_days values.
While this code run normal and can output delivery_days

$categoryId = 1662;
$category = $obj->create('\Magento\Catalog\Model\Category');
$category->load($categoryId);

$collection = $obj->get('\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor');
$collection->addCategoryFilter($category);
$collection->addAttributeToSelect('sku');
$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('price');
$collection->addFinalPrice();
$collection->addMinimalPrice();
$collection->addAttributeToSelect('final_price');
$collection->addAttributeToSort('price', 'DESC');
$collection->getSelect()->joinLeft(
    ['delivery' => 'catalog_category_delivery'],
    'e.entity_id = delivery.product_id',
    'delivery_days'
);

foreach($collection as $product) {
    echo $product->getId();
    echo $product->getName();
    echo $product->getData('delivery_days');
    die;
}

I appreciate any help. thank you.


texts: magento coupon code not apply on grandtotal

texts:
I have issue/confusion.

While I try to add a coupon code to my Magento 1 store at that time the Grand total (Including Tax) not changing.

Coupon information

  Code: demo123
  Condition: for all products
  Action: 5% of products prices.

Issue/Confusion

While you check in image.

Total = 12.99
And discount = -0.65

So grand total(Include Tax) must be 12.34 but as you see in the image it is showing me wrong.

Tax = 21%

Any idea why this is happening?


texts: How to export all attributes and attribute sets from one magento installation and import to other installation?

texts:
I need to export all the product attributes and attribute sets from my current website (Enterprise Edition 1.12.0.0) and import all of them to a new website (CE 1.8).

I've gone through these:

Importing attributes to a new magento installation
n98-magerun
exporting-and-importing-attributes-in-magento

But can't figure out how to export all the attributes first moreover I can't spend money for any extension for this process :( as my company won't provide it.

Can some one point me the right direction?