texts: Apply Coupon code to QUOTE with external script Magento

texts:
i want to apply coupon code from external script, that will set code and discount amount to quote and final result will be saved quote with new total. I have done following but not saving quote.

        $quoteid = "53701";
    $couponCode = "Discount99";
    $oCoupon = Mage::getModel('salesrule/coupon')->load(trim($couponCode), 'code');
    $oRule = Mage::getModel('salesrule/rule')->load($oCoupon->getRuleId());

    if($oRule->getRuleId() && $oRule->getRuleId() > 0){
        try{
            $quoteObj = Mage::getModel('sales/quote')->setCouponCode($oCoupon)->load($quoteid);
            $quoteObj->setTotalsCollectedFlag(true)
                ->collectTotals()
                ->save();
            $returndata["success"] = "1";
            $returndata["message"] = "Coupon Applied Successfully";
            $returndata["data"]["discount_amount"] = $oRule->getDiscountAmount();
        }catch (Exception $e){
            $returndata["success"] = "0";
            $returndata["message"] = "Cart Coupon update Failed";
            $returndata["data"] = null;
        }
    }else{
        $returndata["success"] = "0";
        $returndata["message"] = "Invalid Coupon";
        $returndata["data"] = null;
    }
    echo json_encode($returndata);
    exit;


texts: Magento 2: Hide "Sources" section on Add/Edit product page (for some users)

texts:
I have a user role that's allowed to edit products, but shouldn't be able to manipulate inventory for the product (e.g. the "Sources" section of the add/edit product page, the catalog is using Multi Source Inventory)
The section should remain for all other user roles.
Is there a way to achieve this via XML or a plugin? I'll be able to use CSS as a last resort, but I prefer proper solutions where possible.


texts: How do I get a list of all class rewrites in Magento 2?

texts:
We use plugin/preference to extend/rewrite core class functionality.

How I can print list of all custom module classes which has rewritten core classes in custom extensions?


texts:
Magento connect manager showing login screen in console.

I have installed 1.9.1.0 ver of magento, Want to upgrade my extension. But when i select any extension version for upgrade and click on commit changes button. It scroll me to console area and shows login page of connect manager instead of console window. After putting credential of connect manager it gives message that "No actions selected". But all these functionality is working fine on Local side.

Please help me.


texts: magento 2.1 custom theme header minicart layout overriding not working

texts:
I am building a new theme in magento 2.1. I need to override the default header minicart of magento 2.1. For that I had copied

vendor\magento\module-checkout\view\frontend\web\template\minicart\content.html

and pasted it in

app\design\frontend\vendor\theme\Magento_Checkout\web\template\minicart\content.html

But Whatever change I make it in the content/html in my custom theme, it is not affecting in my website. I have deployed the static contents and cleared caches. Still no result. Can any one please help me to find out where it gone wrong? Thanks in advance.


texts: Magento 2: What's best way to convert MySql to Magento

texts:
I've below MySql query, I would like to change use it in Magento format.

How can i do that ?

  SELECT customer_entity_varchar.value, customer_entity_text.value from customer_entity INNER JOIN customer_entity_varchar ON customer_entity.entity_id=customer_entity_varchar.entity_id INNER JOIN customer_entity_text ON customer_entity.entity_id = customer_entity_text.entity_id

I've tried below but it only returns me. One table values not other ones.

 $connection = $this->_resource->getConnection();
    $select = $connection->select()
        ->from(
            ['customer_entity']
        )
        ->join('customer_entity_varchar', 'customer_entity.entity_id = customer_entity_varchar.entity_id')
        ->join('customer_entity_text', 'customer_entity.entity_id = customer_entity_text.entity_id');
    $selectnew = $connection->fetchAssoc($select);
    echo "<pre>";
    print_r($selectnew); exit;

Any help would be really appreciated.


texts: How to unset block from container in Magento 2?

texts:
I want to unset the block assigned to the container. For example, catalog.compare.sidebar. It is defined in the layout in the following way:

<referenceContainer name="sidebar.additional">
    <block class="Magento\Framework\View\Element\Template" name="catalog.compare.sidebar"
           template="Magento_Catalog::product/compare/sidebar.phtml">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="compareProducts" xsi:type="array">
                        <item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </block>
</referenceContainer>

I would like to do something like this:

<referenceContainer name="sidebar.additional">
    <action method="unsetChild">
        <argument name="block" xsi:type="string">catalog.compare.sidebar</argument>
    </action>
</referenceContainer>

But this doesn't work, because sidebar.additional is a container. How can I unset the block?


texts: Set collection sort order to a specific value

texts:
This should be a fairly straightforward question, but I haven't been able to locate any answers online regarding it. I have the following in Magento:

$consultantCollection->setOrder('firstname', 'DESC');

Which translates in MySQL to:

ORDER BY `firstname` DESC;

What I actually want is to be able to sort by a specific 'firstname' value. In MySQL, this is what I'd like to accomplish:

ORDER BY `firstname`='Peter' DESC;

This way, I can pull a list of 100 people with the same last name, but get any with a specified first name to appear first in the result set.

Unfortunately, I haven't been able to locate any documentation online as to how to achieve this. I know it's an edge case, but it's rather infuriating to have nothing in the Magento docs on how to do something that SQL can handle natively without any hassle.

Insight appreciated!


texts: Dependencies of Third Party Libraries In Magento 2

texts:
Recently I installed Mpdf library using composer in my Magento 2.1.7 local setup, and It is working perfect on localhost. Now I have to move those libraries to live server (I can not install there through composer as I don't have permission.) for that I have moved mpdf directory from magentoRoot/vendor/mpdf at same path on live, but it is not working on live server and throwing below error

  Uncaught Error: Class 'Mpdf\Mpdf' not found

After moving files I have ran setup:upgrade and content:deploy commands.
What I am missing here?  Is there any other changes needed along with moving the library files?


texts: Overload a Block in local Module (sales_order_grid)

texts:
I am trying to overload the core/mage/adminhtml/sales/order/grid.php Block. The Problem is, the Block is already overwritten by another Module (Raveinfosys Deleteorder).
So i have to try, to overload the grid.php of the local Module Deleteorder... but it doesnt work... :(

Thats what i try last:

etc/config.xml

<config>
<modules>
    <company_modulename>
        <version>0.0.1</version>
        <depends>
            <Mage_Adminhtml />
            <Raveinfosys_Deleteorder />
        </depends>
    </company_modulename>
</modules>
<global>
    <blocks>
        <deleteorder>
            <rewrite>
                <sales_order_grid>Company_Modulename_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </deleteorder>
    </blocks>
</global>

Block/Adminhtml/Sales/Order/Grid.php

class Company_Modulename_Block_Adminhtml_Sales_Order_Grid extends Raveinfosys_Deleteorder_Block_Adminhtml_Sales_Order_Grid
{
    protected function _prepareColumns()
    {
        .....
    }
}

UPDATE

But how can i manually manage the hierarchy when i am not able to rewrite the custom module file? i need to rewrite the deleteorder class, because that on is rewriting the core file.

i want to do: myClass extends deleteorderClass, deleteorderClass extends coreClass (without changing the deleteorder module files)


texts: How to use dynamic parameter in custom rest api module?

texts:
Here is the url I want to to access the custom rest api.

http://127.0.0.1/index.php/rest/V1/customapi/filter1/sku_gt_2/filter2/price_gt_10

How do I define webapi.xml & the method parameters in interface?

<route url="/V1/customapi/add/:^filter/:value" method="GET">
    <service class="Custom\Pluginname\Api\CustomInterface" method="add"/>
    <resources>
        <resource ref="anonymous"/>
    </resources>
</route>

interface:

public function add($filter, $value);

Is the about parameter filter can be received as a array?


texts: How to change text "You have no items in your shopping cart." in minicart in magento 2

texts: How to change the text "You have no items in your shopping cart." in mini cart in Magento 2


texts: Create programmatically a product attribute editable with Page Builder

texts:
i need to programmatically create a bunch of custom product attributes, some editable with Page Builder. So i followed https://devdocs.magento.com/page-builder/docs/how-to/how-to-use-pagebuilder-for-product-attributes.html

First of all, i developed a custom module and created my custom attributes via Setup script. For instance, nota_cata has to be editable with PageBuilder:

'nota_cata' => [
   'type' => 'text',
   'backend' => '',
   'frontend' => '',
   'label' => 'Nota de cata',
   'input' => 'textarea',
   'class' => '',
   'source' => '',
   'global' =>
     \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
   'visible' => true,
   'required' => false,
   'user_defined' => true,
   'default' => '',
   'searchable' => false,
   'filterable' => false,
   'comparable' => false,
   'visible_on_front' => true,
   'used_in_product_listing' => false,
   'unique' => false,
   'apply_to' =>
     'simple,grouped,configurable,downloadable,virtual,bundle',
   'attribute_set_id' => self::ATTR_SET,
   'group' => '',
   'source' => '',
]

Next, i created app/code/Vendor/Module/view/adminhtml/ui_component/product_form.xml file to change my attribute input to Page Builder:

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="drinks">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Drinks</item>
                <item name="sortOrder" xsi:type="number">100</item>
            </item>
         </argument>

        <field name="nota_cata">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                    <item name="class" xsi:type="string">Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="label" translate="true" xsi:type="string">Nota de Cata</item>
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="is_pagebuilder_enabled" xsi:type="boolean">true</item>
                        <item name="pagebuilder_button" xsi:type="boolean">true</item>
                    </item>
                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="source" xsi:type="string">product</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">nota_cata</item>
                    <item name="sortOrder" xsi:type="number">60</item>
                    <item name="rows" xsi:type="number">8</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

But i get this in backend product form:

There's not only a pagebuilder button as expected, but also a text area with my attribute info. Both fields show attribute current data and change its value.

How can i make that only pagebuilder link is shown in frontend?

Any help will be appreciated.
Thanks in advance,
Antonio


texts: Product sorting error for arrow(asc & desc)

texts: In Magento, The product sorting by name, price..and by arrow is also not working. I tried many solutions and worked, but the problem is not fixed. Can anyone do this favour to me by helping this ? please


texts:
I need to perform a SKU bulk update in an existing store. I found this script: http://vagento.com/update-bulk-product-sku-using-csv-magento-2/ that works great.

The only problem is that after SKU's are updated, all product variations (for configurable product) are not linked anymore. These products are linked based on SKU, so after changing this value the Configurable Product does not contain any child products anymore.

Is there a fix for this problem? How can I preserve the child products?


texts: Status not shown label in admin grid in magento 2

texts:
shippingbar_post_listing.xml

<column name="status">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">CM\Shippingbar\Model\Status</item>
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">text</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
                <item name="label" xsi:type="string" translate="true">Status</item>
            </item>
        </argument>
    </column>

  CM\Shippingbar\Model\Status.php

  <?php

namespace CM\Shippingbar\Model;

use Magento\Framework\Data\OptionSourceInterface;

/**
 * ProductStatus Class
 */
class Status implements OptionSourceInterface
{
 /**
     * @var \CM\Shippingbar\Model\Productlabel
     */
    protected $model;

    /**
     * Constructor
     *
     * @param \CM\Shippingbar\Model\ModelFile $model
     */
   protected function _construct(\CM\Shippingbar\Model\Shippingbar $model)
    {
$this->model = $model;
 }

    /**
     * Get options
     *
     * @return array
     */
    public function toOptionArray()
    {
        $options[] = ['label' => '', 'value' => ''];
        $availableOptions =$this->model->getAvailableStatuses();
        foreach ($availableOptions as $key => $value) {
            $options[] = [
                'label' => $value,
                'value' => $key,
            ];
        }
        return $options;
    }

}

  CM\Shippingbar\Model\Shippingbar.php

 <?php
namespace CM\Shippingbar\Model;

class Shippingbar  extends \Magento\Framework\Model\AbstractModel
{
    const STATUS_ENABLED = 1;
    const STATUS_DISABLED = 0;

    protected function _construct()
    {
        $this->_init('CM\Shippingbar\Model\ResourceModel\Shippingbar');
    }

     public function getAvailableStatuses()
    {
        return [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];
    }
  }


texts: Tooltip functionality in UI grid column Magento-2

texts: I need to add tooltip functionality in UI grid column for Magento-2. When hover on particular record which is available in that particular column then that record's description is display on tooltip. It's done already in Magento-1. I want same which is mention in below image for Magento-2.


texts:
I have set up a Catalog Price Rule for all products and I can set a start and end date but what about the time?

Is there a way that I can add the time to the end date?


texts: Add sku as url for Programatically created Product

texts:
I am creating Product Programtically. right now, i am giving product name as url for newly created Product, but i want to give product sku as url key .
example : Original Product :  name : test [url key = test1 , sku = 1234 ]
Programtcally created Product : name : test [url key = test1 , sku = abcd ]
Instead of test1 i want to give new product's url-key as abcd, so that i can see in site with this url : sitename.com/abcd.html
public function saveProduct($type, $doSave = true, $originalProduct, $newImagePath)
{
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
            $product = Mage::getModel('catalog/product');

            $rand = rand(11, 999999999);
            $product->setTypeId($type)
            ->setSku('CDSB1_sku' . $rand);

            $product->setIsMassupdate(true)->setExcludeUrlRewrite(true);
            $product->setName($originalProduct->getName());
            $product->save();
}

if that is not possible atleast i want to give some random number for "Url Key"


texts: Magento2 Dynamic Rows not providing position with data array

texts:
I have created a dynamicRows component for Customer Edit Form.
For some reason, if I set visible to false on the field "position", when I submit a new record, the position is never part of the data array.

<field name="position">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <!-- item name="source" xsi:type="string">customer</item -->
                        <item name="dataType" xsi:type="string">number</item>
                        <item name="formElement" xsi:type="string">input</item>
                        <item name="componentType" xsi:type="string">field</item>
                        <item name="label" xsi:type="string" translate="true">Position</item>
                        <item name="dataScope" xsi:type="string">position</item>
                        <item name="visible" xsi:type="boolean">false</item>
                    </item>
                </argument>
            </field>

When the field is visible, then the key "position" is provided and everything works perfect, but I prefer this field to stay hidden.
This only happens when adding a new row.

Any thoughts?


texts: Compare the value of an attribute to some other value in a generated list

texts:
I put this code in my view.phtml file to retrieve a list of an attribute's values in all product page.

 <?php $attribute_code = "my_attribute_code" ?>
 <?php $attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code) ?>
 <?php $options = $attribute_details->getSource()->getAllOptions(false) ?>

         <?php foreach($options as $option): ?>

             <?php echo $option['label']; ?>

         <?php endforeach; ?>

Now, I need to highlight, (for example with just a simple css font-weight:bold;)
the value in the list that corresponding to the product.

For example, if my_attribute_code is color_tone

with value : very light; light; medium; medium dark; dark;

and if the product has this attribute set to light,

Then the list that I retrieve on it's page should be :

very light

light

medium

medium dark

dark


texts: Why don't i get Newsletter subscribe action Url in form in my custom .phtml file

texts:
I am just wondering why i am not getting the action Url in my Newsletter Subscribe form. I am calling the newsletter subscription form in my custom phtml file. I do get the form but when i inspect element the form action remains empty.

I am using the same code which is in subscribe.phtml

P.S I am calling the block like this in my custom phtml file.

include ($block->getTemplateFile('Magento_Newsletter::custom_subscribe.phtml'))

The custom_subscribe.phtml is my custom file with just change in style as i didn't tweak the main phtml.


texts: Magento 2 - Custom user edit tab not displaying

texts:
I try to add a new tab on Admin user edit

I use this code,

adminhtml_user_edit.xml

<?xml version="1.0" encoding="utf-8" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="Test_adminhtml_user">
            <action method="addTab">
                <argument name="name" xsi:type="string">custom_tabs</argument>
                <argument name="block" xsi:type="string">Testing\test\Block\Adminhtml\User\Tab\Test</argument>
            </action>
        </referenceBlock>

</page>

Test.php

<?php

namespace Testing\test\Block\Adminhtml\User\Tab;

/**
 * Order custom tab
 *
 */
class Test extends \Magento\Backend\Block\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface
{
    protected $_template = 'tab/view/test.phtml';

    /**
     * View constructor.
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        array $data = []
    ) {
        $this->_coreRegistry = $registry;
        parent::__construct($context, $data);
    }

    /**
     * Retrieve order model instance
     *
     * @return \Magento\Sales\Model\Order
     */
    public function getOrder()
    {
        return $this->_coreRegistry->registry('permissions_user');
    }
    /**
     * Retrieve order model instance
     *
     * @return \Magento\Sales\Model\Order
     */
    public function getOrderId()
    {
        return $this->getOrder()->getEntityId();
    }

    /**
     * Retrieve order increment id
     *
     * @return string
     */
    public function getOrderIncrementId()
    {
        return $this->getOrder()->getIncrementId();
    }
    /**
     * {@inheritdoc}
     */
    public function getTabLabel()
    {
        return __('My Custom Tab');
    }

    /**
     * {@inheritdoc}
     */
    public function getTabTitle()
    {
        return __('My Custom Tab');
    }

    /**
     * {@inheritdoc}
     */
    public function canShowTab()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function isHidden()
    {
        return false;
    }
}

?>

test.phtml

        <?php /* @escapeNotVerified */
            echo __('Information for new Order tab') ?>

        <?php echo $block->getChildHtml(); ?>

            <?php /* @escapeNotVerified */
                echo __('Order ID:') ?>
            <?php echo $block->getOrderIncrementId(); ?>

            <?php /* @escapeNotVerified */
                echo __('Last History:') ?>
            <?php echo __('History of order') ?>

but it's not displaying on admin user edit page, is there any solution ?


texts: Keeping files in one server and media files in another server

texts:
we have a magento site with thousands of products. it will grow for millions
so we are worrying about performance of the server.

we are planning to put media folder [ images ] in one server and files in another server.
we bought a magento extension to upload products through excel sheet . but when we are uploading excel sheet, site will load very slowly and backend will not open.
is there any way we can do this ?


texts:
I have a website which has two stores fr and en. Now I have almost 1500 products and we would like to add language switching in it. we did it but issue is that most of the product have same URL key for both stores, which are working fine. Some of them have different url for different stores. For them I have added URl rewriting in admin.

Is there a way to find number of product which have different URL for different stores. So ot will be easy for me to add url rewriting for them.


texts: Magento 2 : Add condition for form element in email template

texts:
Added new input field in default Contact form :

  /magento_root/app/design/frontend/VENDER_NAME/YOUR_THEME/Magento_Contact/templates/form.phtml

<input title="Test Id" name="testid" id="testid" value=""/>

Created new custom template and assigned it to Contact Form with below code.

{{trans "Test Id: %testid" testid=$data.testid}}
{{trans "Name: %name" name=$data.name}}
{{trans "Email: %email" email=$data.email}}
{{trans "Phone Number: %telephone" telephone=$data.telephone}}
{{trans "Comment: %comment" comment=$data.comment}}

I tried to add condition like :

{{depend $data.testid}}
  {{trans "Test Id: %testid" testid=$data.testid}}
{{/depend}}

But this is not working.

If $data.testid is empty then I don't want to print that line :

{{trans "Test Id: %testid" testid=$data.testid}}


texts: How completely removed Remove Billing Address From Checkout


texts: magento "erasing" simple products from configurable association

texts:
This is in magento 2.1.3

I have a bunch of simple products imported, as well as the configurable product that is supposed to be imported.

At first I could not find the link to "add products manually" under configurations. Then I read that you have to first add a configuration through the wizard for that option to show.

So I added a fake configuration through the wizard, and then I am able to associate the simple products. I click save on the configurable product, and then the simple products that were added disappear.

I know this whole system seems a little finicky right now, but is there something I am missing that would make it work?


texts: SUPEE 7405 Enterprise Edition Fatal error Undefined class constant 'AREA_ADMINHTML

texts:
After installing supee 7405

  Fatal error: Undefined class constant 'AREA ADMINHTML in
  app/code/core/Mage/Core/Model/Config.php

It is enterprise edition 1.14


texts: Magento 2 admin Uncaught TypeError: this.linksFieldset(...).visible is not a function

texts:
When we edit product from admin then its showing loading continue and also getting this error

"Uncaught TypeError: this.linksFieldset(...).visible is not a function"

is showing error in console. We have opened other product(xyz) it opens without any error.

We just migrate from M1 1.9.3.4 to M2 2.3.5 using data migration tool

Note:When i change attribute set directly from database "default to our attribute set(changed attribute_set_id from 4 to 9(database - catalog_product_entity))" then page is open without console error

please check screenshot -


texts:
I would login by controller in this way:

      $customer = $this->customerAccountManagement->authenticate("paolomondillo@gmail.com","provaprova");
      $this->_session->setCustomerDataAsLoggedIn($customer);
      $this->_session->regenerateId();

But in this way I'm not really logged:

Instead of:

What I wrong?


texts: How to Magento 2 Last ordered id and how to get last 2 orders details

texts: I have tried to show last 2 ordered details with that particular id. But there is only one last order details are showing.


texts: How to add "ADD TO COMPARE" link in custom phtml in magento?

texts: I have added custom phtml and displayed the products information. Now, I want to add the link "ADD TO COMPARE" for the products.


texts: Strange product list look : which Magento module?

texts:
Does someone know which Magento module allow to do product list look like this : https://www.gemmyo.com/pour-elle/les-essentiels/bagues.html ?

Thx


texts:
I Have next question, i added attubute:

<?php
                    $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
                    $setup->addAttribute('customer', 'vat', array(
                    'label'     => 'VAT',
                    'type'      => 'varchar',
                    'input'     => 'text',
                    'visible'   => true,
                    'required'  => false,
                    'position'  => 1,
                    ));
                    $eavConfig = Mage::getSingleton('eav/config');
                    $attribute = $eavConfig->getAttribute('customer', 'vat');
                    $attribute->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit'));  //enable all action
                    $attribute->save();
                    ?>

now i need add condition: if the attribute is empty, print the value NO in vat field

how i can do this better?
Thanks


texts: Shipping cost calculated on subtotal Magento 2.3

texts:
I need to set my shipping amount to be a percentage of the subtotal
My requirement would be: minimum of 7€ and 7% of the subtotal if more.
I can see that in flat rate you can set a fee with a percentage, but it's calculated o the shipping cost, and not from the order itself.
(ex. it's giving me 7,49€ with a shipping price of 7€ and a fee of 7%, while the subtotal is 10€)
Can I get the wonted requirement with default settings? If not, which extension should I use?


texts:
I need to place a custom block below the cart table on the cart page in magento 2. At the moment I'm only able to place it above, so it's displayed above the table AND the cart summary sidebar.

Any advice? Thanks!


texts: Make Adjustments To final_price Render Class On Product Pages Magento2

texts:
I am trying to change the render class for the final_price renderer on the product pages in Magento2. I have found the following block inside the vendor/magento/module-catalog/view/base/layout/catalog_product_prices.xml file:

<block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
    <arguments>
        <argument name="default" xsi:type="array">
            <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
            <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item>
            <item name="default_amount_render_class" xsi:type="string">Magento\Framework\Pricing\Render\Amount</item>
            <item name="default_amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
            <item name="prices" xsi:type="array">
                <item name="special_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item>
                </item>
                <item name="tier_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/tier_prices.phtml</item>
                </item>
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item>
                </item>
                <item name="custom_option_price" xsi:type="array">
                    <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                </item>
                <item name="configured_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\ConfiguredPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/configured_price.phtml</item>
                </item>
            </item>
            <!--<item name="adjustments" xsi:type="array"></item>-->
        </argument>
    </arguments>
</block>

I have setup a custom module to apply the update. What layout XML would I need to use to update the class without replacing the entire block? Would I make use of the adjustments item that is commented out of the above snippet?


texts: How to call Magento sessions outside Magento

texts: I have to call Magento cart and user sessions outside the Magento. I have to call sessions in core PHP project where i have to use Magento backend and core PHP project as frontend.


texts: Display Country of Manufacturer on Category Page Navigation Filter

texts:
When we add a product from Admin. We have field "Country of Manufacturer".

Would like to display that as Navigation Filter on Frontend.

From Admin -> Product Attribute By Inspect Element, able to Save Use In Search, but for "Use in Layered Navigation" & "Use in Search Results Layered Navigation" it keep resetting value.

Then i tried to manage using Table.

SELECT * FROM magento.catalog_eav_attribute;

For attribute_id = 111.

I have set

is_visible
is_searchable
is_filterable
is_comparable
is_visible_on_front
is_html_allowed_on_front
is_filterable_in_search
used_in_product_listing
is_visible_in_advanced_search
is_used_in_grid
is_visible_in_grid

to 1. So now my backend `country_of_manufacuter' looks OK on Admin Side, But Frontend side still it's not displaying.

Have done Indexing, Clear Cache as Well.

How to achieve this? How to display Weight as Well?


texts: How do I add a custom dropdown filter in a grid

texts:
This is my code:

   $this->addColumn(
       $key,
       array(
           header' => Mage::helper('core')->__($key),
           'index' => $key,
           'filter' => 'adminhtml/widget_grid_column_filter_select',
           'sortable' => true,
       )
   );

I want to get all of the values from my column and put it in the dropdown options values and to filter them. Is there a way to do that ? At the moment I got an empty dropdown.

[UPDATE]

For instance if my values are 2,3,2,3,4,5,6,7 . I want to have in my dropdown the following values: 2,3,4,5,6,7

[UPDATE 2]

I managed to put the values in the dropdown. See My code:

$this->addColumn(
    $key,
    array(
       'header' => Mage::helper('core')->__($key),
       'index' => $key,
       'filter' => 'adminhtml/widget_grid_column_filter_select',
       'sortable' => true,
       'renderer' => $render,
       'type'      => 'options',
       'options'   => $this->_getOrderType(),
      )
);
public function _getOrderType(){
        $types = new Varien_Object(array(
            "Frontend" => "Frontend",
            "AdminPanel" => "AdminPanel"
        ));
        return $types->getData();
}

But my filter doesn't work. If I filter after smth I got an empty grid.

[UPDATE 3]

Update with the render function:

public function render(Varien_Object $row)
    {
        $value = $this->_getValue($row);
        if ($value == ""){
            return "Frontend";
        }else {
            return "AdminPanel";
        }
    }


texts:
I have set the secure_base_url to httpsand also have set Use Secure URLs in Frontend to yes. Still when i navigate the site i get warnings such as

Mixed Content: The page at 'https://mysite/customer/account/index/' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'http://mysite/checkout/cart/updatePost/'. This endpoint should be made available over a secure connection.

When i change the unsecure_base_urlto https the site works perfectly without any warnings. Still i don't want to secure all the pages of the site by changing the unsecure_base_urlto https. I want to set certain pages secure (by setting only the secure_base_url to https) without SSL mixed content. How can i solve this problem?


texts:
I have enable Authorize.net as a payment method in magento 2.3.3
I have entered all corrects details in backend. https://prnt.sc/tiu0ue
Environment is set to Sandbox. My sandbox account is also in Test mode.
During checkout after i enter card details and click on place order, i am getting error as " An error occurred during processing. Please try again."
Have anybody come across this error? Please help.


texts: magento override block function not calling

texts:
I override my sales order view info but the function not working.

config.xml

<global>
<adminhtml>
<rewrite>
 <sales_order_view_info>MPS_Delivery_Block_Sales_Order_View_Info</sales_order_view_info>
</rewrite>
</adminhtml>
</global>

info.php

class MPS_Delivery_Block_Sales_Order_View_Info extends Mage_Adminhtml_Block_Sales_Order_View_Info
{
    public function getMyTest(){

        return "Test";
    }
}

I called in my template in this <?php echo $this->getMyTest();?>

What mistake i made here


texts: Magento 2 Store Configuration Fields not Showing updated Data

texts:
I am having an issue. When I update/save data in Store configuration, then it get's updated in the database, but on admin panel, it's not getting changed.

It's urgent so please help me with this.

TIA


texts: I recently notice google is indexing my site one with /home and one without. clearly this www.test.come/home URL exist but i do not see this url in my URL rewrite in the back-end. what is the best solution to remove this /home so google is not indexing the home pages


texts: Sage Pay Issue Magento 2.3 (Porto Theme)

texts: I am using the porto theme with magento 2.3 version but i can't able to place order using sage pay credit card.


texts:
The issue is that sometimes, searching for something leads to page not found. This seems to happen randomly with different search queries and layered filters, I haven't been able to reproduce it but I see it in the logs, once cache is cleaned it works again.

Example:

  "GET http://www.project.de/catalogsearch/result/index/?fcode=walnuss&manufacturer=Bette&q=Badewannen HTTP/1.1" 404 13720 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "-"

Seems most of them are from bots.

I've been looking through the code to see the cases when this could happen, but the result controller doesn't have any that I could see and the project uses solr, but I don't see any coresponding log entries with the same query so I am guessing it redirects sometime before.

The only other places that I found where it would redirect to 404 are:

Standard router is missing, route never gets matched
Router doesn't match the route/action
Somewhere inside Enterprise_PageCache

I was hoping somebody would have some more information about exactly when this can happen or maybe had a similar problem.
The project runs on EE 1.14.0.1.


texts:
Am i on the latest version of Magento? We are on 235p1 and version is community. Are there critical patches available?
Thanks.


texts: magento listing all bundled product made using specific product id

texts:
i had make few bundled product which is bacially group of two products.

now i want to get list of all product id that have other product in bundle.

Suppose i made bundled product using (1,2) ,(1,4) ,(3,2), (1,6)

by id 1 i want to get product ids: 2,4,6

how can i do it


texts:
I add a custom column to order grid but after that filter not working correctly and throws an error every time:

  A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

My code of column is:

<?php

namespace Magento\Sales\Ui\Component\Listing\Column;

use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;

/**
 * Class ProductName
 */
class ProductName extends Column
{

    protected $productFactory;
    protected $orderFactory;

    /**
     * Constructor
     *
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param array $components
     * @param array $data
     */
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        \Magento\Sales\Model\OrderFactory $orderFactory,
        array $components = [],
        array $data = []
    ) {
        $this->productFactory = $productFactory;
        $this->orderFactory = $orderFactory;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                # $item[increment_id] is the order id
                $order = $this->orderFactory->create()->loadByIncrementId((int)$item['increment_id']);
                $orderItems = $order->getAllItems(); # get all items
                $item[$this->getData('name')] = '';
                foreach ($orderItems as $index => $oi) {
                    $product = $this->productFactory->create()->load($oi->getProductId());
                    $item[$this->getData('name')] .= $product->getName();
                    $item[$this->getData('name')] .= (sizeof($orderItems) > $index+1) ? ", " : "";
                }
            }
        }

        return $dataSource;
    }
}


texts:
I was just wondering whats does src-dataX2 mean?

As i see it in core files (that i have duplicated) and when chaneg the code from

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')?>" data-srcX2="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($imgX*2, $imgY*2) ?>" width="<?php echo $imgX; ?>" height="<?php echo $imgY; ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

to

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')?>" width="<?php echo $imgX; ?>" height="<?php echo $imgY; ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

I see no change in the image.


texts: Stop propagation of attribute values between store views if value empty

texts:
I have following problem with magento 2.2.4.
Let's say i have 2 store views and 1 product with text properties document_name (scope: store view).
When I remove value of the property from secondary store using rest api call
{
    'attribute_code': 'docuemnt_name',
    'value': None
}

Product value for docuemnt_name is automatically fetched from default store view. But "Use Default Value" checkbox is unchecked.
Can this be stopped (so I want it to stay empty)?


texts:
I need to add custom css in head dynamically, where css url is dynamic.

I can add using below code but page will get cache, I need to add css dynamically each page re-fresh, css url will be also changed.

<body>
        <referenceBlock name="head.additional">
            <block class="NAMESPACE\CUSTOMMODULE\Block\CustomCss" name="custom_css" template="customCss.phtml" before="-"/>
        </referenceBlock>
    </body>

Its some thing like CDN. Each time when css changed my custom css URL also change.


texts: Magento 2 grid filter(active filter) lost on page reload

texts:
I am using Webkul Marketplace ext. and they have issue on active filters.

after filtering whenever reloading the page or visiting other page and backing on the filter page then filter get losses and it opens normally(without any filter).

actually there is separate dashboard for the seller where sellers can manage orders,products etc.so these UI's are some similarity like  admin.

Snippet:-

After Filter:- it works as expected.

Revisiting on Filter Page:- Filter gets lossed and act as normally.

I R&D and they suggested to use "bookmark" used but no luck.

please help me to resolve this problem.


texts: Send transactional email from root folder magento 2

texts: How to send transactional email template from Magento 2 root folder?


texts: if-condition in Order update EmailTemplate

texts:
I like to use differrent text for order_update email template.

Admin->Marketing->Email template i create new template for "order update"

If $order.getStatusLabel() == "Cancel" I like to add some custom text. How to add $order.getStatusLabel() == "Cancel" in if condition or {{depend}}.

I used if condition in

but my result getting:

Please let me know

Thank you.


texts: How to Create a Custom Product image Attribute with Texbox in magento 2.3

texts:
Need to create a custom product attribute like below image but image uploader(Browse) instead of select
[


texts:
I'm trying to add button in customer address form. But I don't know how to do it from customer_form.xml file. If any one knows please suggest me.

I have registered button control on ui_definition.xsd and ui_components.xsd file but still it's showing like textbox instead of button.

My Code is

Magento/Ui/etc/ui_definition.xsd

<xs:complexType name="definition">
        <xs:annotation>
            <xs:appinfo>Registering components in the system and basic setup</xs:appinfo>
            <xs:documentation>Registering components in the system and basic setup</xs:documentation>
        </xs:annotation>
        <xs:all>
            <!-- Components list -->
            <xs:element type="tab" name="tab"/>
            <xs:element type="dataSource" name="dataSource"/>
            <xs:element type="paging" name="paging"/>
            <xs:element type="massaction" name="massaction"/>
            ..... etc
            <!--Custom Button Start-->
            <xs:element type="button" name="button"/>
            <!--Custom Button End-->
        </xs:all>
    </xs:complexType>

Magento/Ui/etc/ui_components.xsd

<!--Custom Button Start-->
    <xs:complexType name="button">
        <xs:complexContent>
            <xs:extension base="ui_element">
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:group ref="configurable"/>
                </xs:choice>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!--Custom Button End-->

and I have created Class Button.php from Magento/Ui/Component/Form/Element

<?php

namespace Magento\Ui\Component\Form\Element;

/**
 * Class Button
 */
class Button extends AbstractElement
{
    const NAME = 'button';

    /**
     * Get component name
     *
     * @return string
     */
    public function getComponentName()
    {
        return static::NAME;
    }
}

and finally I have created field from customer_form.xml file

<field name="button">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">button</item>
                    <item name="formElement" xsi:type="string">input</item>
                </item>
            </argument>
        </field>

Running without errors but it's showing textbox instead of button. Could you please suggest me where I went wrong?


texts: Enable certain users to add products to my store

texts:
I'd like to allow some users to sell products in my store, without giving them access to magento's back end.

Is there any extension for doing that ?


texts: Magento 2 admin panel custom controller actions not working

texts:
I created a custom module in adminportal with custom controller in magento 2 but the controller action is giving 404 error page can someone help me on this?

mymodule folder structure is

  app/code/Gokulpriya/CustomMenu/Controller/Adminhtml/Index/Index.php

 <?php
namespace Gokulpriya\CustomMenu\Controller\Adminhtml\Index;
use Magento\Backend\App\Action;
use Magento\Framework\Controller\Result\Raw;
use Magento\Framework\Controller\ResultFactory;
class Index extends Action
{

    public function execute()
    {
        $result = $this->resultFactory->create(ResultFactory::TYPE_RAW);

        $result->setContents('Hello world');

        return $result;
    }
}


texts: do I have to pay for a private server to get magento to work?

texts:
I'm new to magento and am confused about installing it (community ed.). My web provider (123 reg) are saying I need to buy a virtual private server because the memory requirement needs to be on a server of least 256MB. Do i have to pay for vps hosting to get it to work, or is there another way? i thought magento was potentially free

I probably haven't explained the problem very clearly, but here is what 123 reg support said:

  "The Magento application is a heavy eShop to maintain on a shared hosting plan where the memory output is 128Mb, if you check the system requirements Magento needs to be hosted on a server with at least 256 Mb: http://magento.com/resources/system-requirements

  This being given if you ought to upgrade from a shared plan to a VPS it would be possible to host the eShop there, please see our offers page if you are interested to purchase a VPS, this will also offers database management where you can import a SQL file with no size limitations: https://www.123-reg.co.uk/vps-hosting/

  Even if was to run on the current plan you have it is not recommended as it will constantly go offline due to insufficient resources."


texts: Email not sending - core_email_queue not in the database

texts:
Sorry guys I am a bit of a newbe ... But I am facing a problem with sending mails (order confirmation, Invoice, ect ...).

My cron job works fine according to my log but  core_email_queue_recipients and  core_email_queue havn't been created to queue all the emails.

I don't really get how this works but I followed all the steps correctly while I installed Magento but still having the problem.

Is anyone could helpme on that one  ?

I am on Ubuntu 14.04.


texts: Using instafeed.js in Magento via static block

texts:
I tried using instafeed.js from http://instafeedjs.com/ to show an instagram feed using a particular hashtag right before the footer on my homepage.

I added the file instafeed.min.js to my default/theme/js

I created a static block called instafeed with the content

<script type="text/javascript">
    var feed = new Instafeed({
        get: 'tagged',
        tagName: 'awesome',
        clientId: 'my client ID'
    });
    feed.run();
</script>

Then to the homepage layout xml I added

<block type="cms/block" name="instagram" after="previous block's name">
<action method="setBlockId"><block_id>instafeed</block_id></action>
</block>

Is this the correct way to integrate?


texts: Magento 2 How to set Config Provider for all pages?

texts:
I created one module. which have helper function which returns module is enabled or not? Now I want to check if this module is enabled or not in javascript for all pages on the frontend, for that, I want to set function value to config provider like "window.checkoutConfig.customvalue". Now I need like "window.catalog.customvalue" or any global javascript value which can be accessed from every page, How can I do this?

One more example for global config is "BASE_URL" when you write BASE_URL in the console it gives URL, I want the same functionality, just need to add that kind of variable in config.

I know how to set config provider in the checkout with "chckoutConfig" but I want to set that function value in common config provider so I can get that value in every js file or console.

If anyone has an idea about it?


texts: Magento 1.9 Observer - How do visible selected payment gateway only for specific customer group?

texts:
Following code return customer group, how to add condition if customer group "Tester" then only show selected payment gateway?

app\etc\modules\Gta_FindPaymentGateway.xml

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

app\code\local\Gta\FindPaymentGateway\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Gta_FindPaymentGateway>
            <version>1.0.0</version>
        </Gta_FindPaymentGateway>
    </modules>
    <global>
        <models>
            <gta_findpaymentgateway>
                <class>Gta_FindPaymentGateway_Model</class>
            </gta_findpaymentgateway>
        </models>
        <events>
            <checkout_cart_product_add_after>
                <observers>
                    <Gta_FindPaymentGateway_Model_Observer>
                        <type>singleton</type>
                        <class>Gta_FindPaymentGateway_Model_Observer</class>
                        <method>paymenter</method>
                    </Gta_FindPaymentGateway_Model_Observer>
                </observers>
            </checkout_cart_product_add_after>
        </events>
    </global>
</config>

app\code\local\Gta\FindPaymentGateway\Model\Observer.php

<?php
    class Gta_FindPaymentGateway_Model_Observer
    {
        public function paymenter($Observer)
        {
            if(Mage::getSingleton('customer/session')->isLoggedIn())
            {
                // Get group Id
                $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();

                //Get customer Group name
                $group = Mage::getModel('customer/group')->load($groupId);

                 Mage::log($group->getCode(),null,'filter.log',true);
            }
        }
    }
?>


texts: What is the use of Magento\Sales\Model\Order\Email\Container\IdentityInterface in magento 2

texts:
protected function checkAndSend(Order $order)
{
    $this->identityContainer->setStore($order->getStore());
    if (!$this->identityContainer->isEnabled()) {
        return false;
    }
    $this->prepareTemplate($order);

    /** @var SenderBuilder $sender */
    $sender = $this->getSender();

    try {
        $sender->send();
    } catch (\Exception $e) {
        $this->logger->error($e->getMessage());
        return false;
    }
    try {
        $sender->sendCopyTo();
    } catch (\Exception $e) {
        $this->logger->error($e->getMessage());
    }
    return true;
}

What is the use of this line of code $this->identityContainer->isEnabled() ?


texts: Magento2.2.2 SOAP API Create Partial Invoice

texts:
Partial invoice doesn't seem to be working correctly for SOAP requests when multiple item has been ordered.

POST URL: http://dev.test.com/soap/all?services=salesInvoiceOrderV1

SOAP BODY:

    <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:def="http://dev.test.com/soap/all?services=salesInvoiceOrderV1">
    <soap:Body>
        <def:salesInvoiceOrderV1ExecuteRequest>
            <orderId>95</orderId>
            <appendComment>true</appendComment>
            <arguments>
                <extension_attributes />
            </arguments>
            <capture>true</capture>
            <comment>
                <comment>string</comment>
                <extension_attributes />
                <is_visible_on_front>0</is_visible_on_front>
            </comment>
            <items>
                <item>
                    <extension_attributes />
                    <order_item_id>189</order_item_id>
                    <qty>1</qty>
                </item>
            </items>
            <notify>true</notify>
        </def:salesInvoiceOrderV1ExecuteRequest>
    </soap:Body>
</soap:Envelope>

The request returns Invoice id But in Backend Invoice Items are Empty.

Is there a Bug or something I'm doing it wrong ?

Thanks


texts: Magento events not firing on full page cache

texts:
I'm using Amasty Full Page Cache for Magento 1.x CE

When inspecting the events that get fired when page cache is hit, i found that resource_get_tablename and http_response_send_before are the only 2 events that are fired during cache hit.

However attaching an observer to http_response_send_before doesn't do anything when cache is hit.

I looked into dispatchEvent function of Mage_Core_Model_App and found out that $this->_events is empty when cache is hit, so is there any way to attach an observer to any kinds of events? I'm adding some tracking and don't want to modify index.php


texts:
I have the following in config.xml in order to set up a cronjob with magento

<crontab>
    <jobs>
        <mycompany_mymodule>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>mymodule/observer::editEntries</model>
            </run>
        </mycompany_mymodule>
    </jobs>
</crontab>

my controller is:

class Mycompany_Mymodule_Model_Observer{
    public function editEntries() {
        /****************/
    }
}

and i am getting the following error:

'exception ''Mage_Core_Exception'' with message ''Invalid callback: mymodule/observer::editEntries does not exist'' in C:\xampp\htdocs\magento\app\Mage.php:595
Stack trace:
#0 C:\xampp\htdocs\magento\app\code\core\Mage\Cron\Model\Observer.php(301): Mage::throwException(''Invalid callbac...'')
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Cron\Model\Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), ''dispatch'', Object(Varien_Event_Observer))
#4 C:\xampp\htdocs\magento\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent(''default'', Array)
#5 C:\xampp\htdocs\magento\cron.php(74): Mage::dispatchEvent(''default'')
#6 {main}'

full config.xml

<config>
    <modules>
        <mycompany_mymodule>
            <version>1.0.0</version>
        </mycompany_mymodule>
    </modules>

    <global>
        <models>
            <Mymodule>
                <class>Mycompany_Mymodule_Model_Observer</class>
            </Mymodule>
        </models>
    </global>

    <crontab>
        <jobs>
            <mycompany_mymodule>
                <schedule>
                    <cron_expr>* * * * *</cron_expr>
                </schedule>
                <run>
                    <model>mymodule/model_cron::editEntries</model>
                </run>
            </mycompany_mymodule>
        </jobs>
    </crontab>
</config>

----- ediit -----

so the cron attribute should look like this?

<crontab>
    <jobs>
        <mycompany_mymodule>
            <schedule>
                <cron_expr>* * * * *</cron_expr>
            </schedule>
            <run>
                <model>mycompany_mymodule_model/observer::editEntries</model>
            </run>
        </mycompany_mymodule>
    </jobs>
</crontab>


texts: Use Secure URLs in Admin causing loging out issue

texts: When I set Use Secure URLs in Admin to "yes" it causes the backend to logout everytime I view something on the front end. Does anyone know what could be causing this. The backend works fine until I browse the site proper ... then it logs me out.


texts: I added a link in customer account navigation, now I want to create grid and form in frontend for sellers to add products that have all attributes like Manage Products in the backend. How to do that? I'm new to Magento, please help me. Thanks.


texts:
I've setup a custom module that will automatically change the group of sellers on my site depending on their sales and orders. The script runs fine when manually executing it, however when setting up a cron for it, the cron continually dies according AOE Scheduler, with the message:
TRIGGER: shutdown function and the status died.

I have the following code:

config.xml

<config>
<modules>
    <Namespace_Autogroups>
        <version>1.0.0</version>
    </Namespace_Autogroups>
</modules>
<global>

    <models>
        <namespace_autogroups>
            <class>Namespace_Autogroups_Model</class>
        </namespace_autogroups>
    </models>
</global>
<crontab>
    <jobs>
        <switchsellergroup>
            <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
            <run><model>namespace_autogroups/cron::setSellerGroup</model></run>
        </switchsellergroup>
    </jobs>
</crontab>

Cron.php

class Namespace_Autogroups_Model_Cron
{
public function setSellerGroup()
{
  $resource = Mage::getSingleton('core/resource');
  $readConnection = $resource->getConnection('core_read');
  $writeConnection = $resource->getConnection('core_write');
  $table1 = $resource->getTableName('seller_payments');
  $table2 = $resource->getTableName('seller_group');

  $query = "SELECT $table1.vendor_id, SUM($table1.net_amount) AS sum, COUNT(*) as c, $table2.group_code, $table2.parent_id
  FROM $table1
  LEFT JOIN $table2 ON $table2.vendor_id = $table1.vendor_id
  GROUP BY vendor_id";

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

  foreach($collection as $_seller) {
    $_seller['sum'] = $sellSum;
    $_seller['c'] = $orderSum;

    if (!$_seller['parent_id']){
    }

    elseif ($_seller['parent_id'] == 310) {
    }

    elseif ($_seller['parent_id'] == 35868) {
      if($sellSum >= 0 && $orderSum >= 0) {

        $vendorID = intval($_seller['vendor_id']);

        $queryG = "UPDATE {$table2} SET parent_id = 310, group_code = 'group3' WHERE vendor_id='$vendorID'";
        $writeConnection->query($queryG);
      }
      else {}

    }

    else {}

  } } }

The ($sellSum >= 0 && $orderSum >= 0) is just for testing purposes to get it working. parent_id refers to the group id.

Is it the empty else statements?


texts:
I have setup two site on localhost server. It's working fine on local.
But on server it gives wrong url. It give base url on ajax call.

When I use getBaseUrl it give right url

Site setup.

Website1 :: root
Website2 :: root/test1

can any one please guide me on this.


texts: Magento 2 not index price after change user db

texts:
i using magento 2.x, yesterday i wan`t user and pass mysql. Website run success but i checked table catalog_product_index_price. It not insert new row when i insert new product
I reindex and clear cache folder, generated folder. but not changed
Thanks bro


texts: Magento2 How to display prodduct sku in Customer Wishlist Grid

texts: i want to display product sku in Customer Wishlist Grid, does anyone how to do that? Thanks


texts: How to add multiple subproducts to the Magento 1.x cart at the same time?

texts:
I know there are already a lot of answers for how to add multiple products at once. I don't think this is a duplicate because here we are talking about subproducts not products.

Currently on my catalog product view there are 4 radio buttons so that the customer can select 4 different variations of the product. If the customer selects variation #1 and clicks add to cart, then there will be 1 item in the cart. If they go back to the catalog product view and select variation #2 and click add to cart, then there will be two separate items in the cart. So these two variations are essentially two different "products" because they have different "subtitles", different prices and they have their own row on the cart view.

The 4 radio buttons are all part of the same radio button group, thus the customer can only add a single variation to the cart at a time. If they want to add another variation to the cart they must go back to the product page and click add to cart again.

We want to break the radio buttons up into two groups of 2 so that the customer can select 2 variations at once and then click add to cart in order to add the 2 variations to the cart at the same time.

The issue that I am having is that I can't figure out how to alter CartController::addAction so that it will add 2 product variations to the cart at the same time.

The only difference in terms of the $params from one variation to another is the value for $params['super_attribute']['my_val']. If I hardcode this value into addAction() then I can control which variation gets added to the cart - so I know that's what controls the variation.

As a test I thought I would be able to change this:

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

to this:

$params['super_attribute']['my_val'] = 1;
$cart->addProduct($product, $params);

$params['super_attribute']['my_val'] = 2;
$cart->addProduct($product, $params);

but what ends up happening with that approach is that the first one gets added twice(ie. it's the only one in the cart with a quantity of 2). I've tried several other variations of this test code but nothing works.

Is there a way to do this in CartController::addAction(or some of the PHP it calls)? Or should I try a different way(like maybe make an AJAX call to the API)?


texts: Magento2: Can we add navigation layered filter like price filter for other attribute?

texts:
I want to add navigation layered a filter like a price filter for custom attribute:

Attribute name size:

10 above
10 - 20 inch
20 - 30 inch
30 - 40 inch
40 - 50 inch
Under 50 inch

Anyone can tell me It is possible on a custom attribute?


texts:
Our time out is currently set to 50 seconds. After this time Magento automatically returns a 504 Response Code.

Under normal circumstances this is fine. However, I have developed a page that allows wholesale customers to place orders using a spreadsheet type layout which they can order all items on the store in any quantity. There are around 600 products on this system.

While testing it, I have noticed that when I add a quantity of 1 for every product, the page is timing out as the controller I am sending the data to is taking longer than the 50s.

Is there a way to increase page time out in general, or even better, for specific pages?

Thanks


texts: Condition on Custom Tab in Customer Account page

texts:
app\code\companyname\modulename\view\frontend\layout\default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Codility_Customers::css/firstfile.css" media="all and (min-width: 1px)"/>
    </head>
    <body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Customer\Block\Account\SortLinkInterface" name="seller-dashboard-link">
            <arguments>
                <argument name="path" xsi:type="string">seller/customer/index</argument>
                <argument name="label" xsi:type="string">Link 1</argument>
                <argument name="sortOrder" xsi:type="number">800</argument>
            </arguments>
        </block>
        <block class="Magento\Customer\Block\Account\SortLinkInterface" name="seller-dashboard-myorder">
            <arguments>
                <argument name="path" xsi:type="string">seller/customer/orders</argument>
                <argument name="label" xsi:type="string">Link 2</argument>
                <argument name="sortOrder" xsi:type="number">700</argument>
            </arguments>
        </block>

   </referenceBlock>
    </body>
</page>

Now I want to hid Link 1 or Link-2 on some condition. e.g I will check on specific customer group

if(customergroup=="General"){
// then show Tabs otherwise Tabs will not show
}

anyone guide me how put condition here?


texts: Magento setPrice is not work with catalog_block_product_list_collection event?

texts:
This is my config code.

<catalog_block_product_list_collection>
            <observers>
                <smashingmagazine_logproductupdate>
                    <class>smashingmagazine_logproductupdate/observer</class>
                    <method>listingchange</method>
                    <type>singleton</type>
                </smashingmagazine_logproductupdate>
            </observers>
        </catalog_block_product_list_collection>

This is my function.

public function listingchange(Varien_Event_Observer $observer)
{
    $collection = $observer->getEvent()->getCollection();

    foreach ($collection as $product)
    {
       $product->setPrice( 1500 );
    }

}

price get in list.phtml file price code is.

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

The setPrice() is not work. getPrice() function is work fine.

but setPrice() is not work.

please help. thank's


texts: i created some admin users with limited user roles, i want to create a custom login form, so that after login, user will be re-directed to his admin home page.


texts: Magento 2 How can I add loyalty / reward points for customers?

texts:
In Magento 2 Enterprise edition how can i add the reward point for a customer?

Thank you very much.


texts: How can i set a certain payment option to be blocked when delivery address is different

texts:
Would it be possible to not show a certain payment method when a customer uses a delivery address different from the billing address?

Thanks


texts:
I am getting a SQL error on a few category pages after I upgraded to Magento 2.4.0.
I do not have any errors during re-indexing. Flat tables are also disabled. Also, there is no custom code for the category page. Only static content and Products associated to it.
Please suggests what I can do ?
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cat_index_position' in 'order clause', query was: SELECT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `rt`.`avg_percent`, IFNULL(review_summary.reviews_count, 0) AS `reviews_count`, IFNULL(review_summary.rating_summary, 0) AS `rating_summary`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.customer_group_id = 0 AND price_index.website_id = '1'
 INNER JOIN (SELECT `product`.`entity_id` AS `entity_pk_value`, `rt`.`avg_percent` FROM `catalog_product_entity` AS `product`
 LEFT JOIN (SELECT `rova`.`entity_pk_value`, avg(percent_approved) AS `avg_percent` FROM `rating_option_vote_aggregated` AS `rova` WHERE (rova.store_id = 1) GROUP BY `rova`.`entity_pk_value`) AS `rt` ON product.entity_id = rt.entity_pk_value GROUP BY `product`.`entity_id`) AS `rt` ON e.entity_id = rt.entity_pk_value
 LEFT JOIN `review_entity_summary` AS `review_summary` ON e.entity_id = review_summary.entity_pk_value AND review_summary.store_id = 1 AND review_summary.entity_type = (SELECT `review_entity`.`entity_id` FROM `review_entity` WHERE (entity_code = 'product'))
 INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id WHERE (e.entity_id IN (3151, 3165, 3230, 3274, 3484, 3485, 3515, 3563, 3798, 3799, 3812, 3821, 3870, 3894, 3901, 3928, 3929, 3930, 3935, 3936, 3949, 3950, 3952, 3953, 3954, 3957, 3979, 3980, 5101, 5110, 5111, 5112, 5113, 5115, 5116, 5117)) ORDER BY FIELD(e.entity_id,3151,3165,3230,3274,3484,3485,3515,3563,3798,3799,3812,3821,3870,3894,3901,3928,3929,3930,3935,3936,3949,3950,3952,3953,3954,3957,3979,3980,5101,5110,5111,5112,5113,5115,5116,5117), `cat_index_position` ASC, `e`.`created_at` DESC


texts:
I would like to have a line between each item purchased on the PDF invoice.

I went to Mage>Sales>Model>Order>Pdf>Items>Invoice>Default.php, made a local copy to not change the core items and added the following line after draw Tax:

/* Separator Line */
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
$page->setLineWidth(0.5);
$page->drawLine(380, 30, 380, 40);

But it doesn't show up. Can someone let me know how the best way to do this.
Would be great, thanks


texts: I cant add more than a quantity of one of any product to my cart. This is for a customer and they are saying that it happened all of a sudden.  I checked sys>config>inventory.  Min qty is set to 10000.  Where else can I check?


texts:
I want to sort catalog products by name in natural order. In order to achieve it i created a custom module and overwrote Mage_Catalog_Block_Product_List_Toolbar.

   public function setCollection($collection)
    {
        $this->_collection = $collection;

        $this->_collection->setCurPage($this->getCurrentPage());

        // we need to set pagination only if passed value integer and more that 0
        $limit = (int)$this->getLimit();
        if ($limit) {
            $this->_collection->setPageSize($limit);
        }
        if ($this->getCurrentOrder() == 'name') {
            //i'm assigning the custom sorted collection
            $this->_collection = $this->_naturalsort($this->_collection);
            //printing the collection to check whether it's in proper order
             $this->_test($this->_collection);
        }else if ($this->getCurrentOrder()) {
            $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
        }
        return $this;
    }

    protected function _naturalsort($collection){
        $prodarr = $collection->exportToArray();
        usort($prodarr, function($a, $b) {
            return strnatcmp($a['name'], $b['name']);
        });
        $collectionsorted = new Varien_Data_Collection();
        foreach($prodarr as $item)
        {
            $varienObject = new Varien_Object();
            $varienObject->setData($item);
            $collectionsorted->addItem($varienObject);

        }
        return $collectionsorted;
    }
    protected function _test($collection){
       foreach($collection as $item2)
        {
            Mage::log($item2['name']);
        }
    }

When logging the collection using my _test method the products are in correct order. Still it doesn't affect the frontend view. The frontend displays a non sorted collection. What am i doing wrong?


texts: Magento Upgrade from EE 1.10.1.1 to 1.13.0.2

texts:
I am trying to upgrade Magento version from EE 1.10.1.1 to 1.13.0.2. I took old DB and imported it into my development environment, I mapped that DB with 1.13.0.2 code base.

Then I tried to access the environment through the browser, it took many hours (more then 10 hours) and still loading. But the DB table import was reflected in it 3 hours. Now there is no  DB changes also.

Can anyone kindly guide me, how to resolve or track the issue.


texts:
can anyone help with this, I'm not anywhere close to calling myself proficient in magento but can normally track most things by trial and error,

I have the problem that on my checkout page I have HTTPS security is compromised by http://www.mfeuk.co.uk/js/mt/widget/frontend.js

ok simple enough, was going to find where it was called from and change to https:, usually does the trick, however I can see it in html if I view source

<script type="text/javascript" src="http://www.mfeuk.co.uk/js/mt/widget/frontend.js"></script>

but this does not tell me where in magento backend files this is, could not see anything in local xml. think I'm just looking in the wrong places.


texts: Magento 2: Programmatically Adding Items to a Container

texts:
In Magento 1, if you wanted to programmatically add a new block to the text/list content block, you could do something like this

$block = $this->getLayout()->getBlock('content');
$block->append($this->getLayout()->createBlock('foo/baz'));

However, in Magento 2, this doesn't work.  Calling something like

$block = $this->getLayout()->getBlock('content');

returns a value of false into the $block variable. I'm relatively sure this is because content is no longer a block -- it's something Magento 2 calls a container.

Is it possible, via PHP, to get a reference to these containers and programmatically add blocks to them?

I know it's possible to do this via the new Layout DSL with something like

<body>
    <referenceContainer name="content">
        <block ... />
    </reference>
</body>

What I want to know is if this is possible to do via PHP, or if PHP level access to the container blocks not possible (either by deliberate or defacto design).  If it is possible -- what are the objects and methods involved?


texts:
I have a color swatcher extension in my website. Previously it's working fine now a days it's not working. I check in consolve it shows

Mixed Content: The page at 'https://domain.com/customize-furnitures.html' was loaded over HTTPS, but requested an insecure image 'http://domain.com/media/catalog/product/cache/0/small_image/210x210/9df78e…5/r/o/rockwell-accent-chair-d83c4092-7f99-44e1-9c69-eaf080aa5d60_600_1.jpg'. This content should also be served over HTTPS.


texts: MageReport: "Malicious code found, you are vulnerable" - possible false positive?

texts:
I get a warning for one of our sites on magereport.com about the famous Credit Cart Hijack:

  Credit Card Hijack detected?

But there is nothing added to "Miscellaneous HTML" or "Miscellaneous Scripts" configurations, and when I check the HTML source code, I don't find any additional scripts that should not be there. Searching in the minified JS for remarkable parts of the example also yields nothing. Patches were always applied immediately.

I watched the Firebug netwok tab while going through the checkout, entering credit card details and going to the next step. No requests were made except to Magento and to the payment provider.

Since the message from Magereport has a question mark, I am wondering:

Does anybody know of false positives, where harmless scripts were identified as malicious? Or am I looking in the wrong places?


texts: Getting customer collection with only those that are subscribed to newsletters

texts:
I need to import a load of customers to a third party email company but need to only import those that are currently subscribed to newsletters.  The import itself has to be a file of customer details which I need to generate.  I know I could load up all customers into a collection and iterate through them, only inserting those that are subscribed into the import file but as we have 90000 plus customers I would rather just load the ones that are subscribed into the collection. The import itself uses an API but it needs to have the import file added as an attachment (fine doing that, just including it for information).

Any ideas?


texts: Fetching order details and display it in module

texts:
I am a novice at Magento development. I am more experienced in Joomla and wordpress and have realized magento isn't as easy as i though, so i now have to request help!

I need help in achieving the following. I have an idea of how to approach this, but i would really appreciate you guys providing me the best solution/steps in achieving this. I dont want to be wasting too much of my time doing trial and error.

I need to create a module that does the following in the admin panel (adminhtml).

When i login, a sub-menu titled "Order Monitor" will be shown under the sales menu.
when clcik, this menu item will open a page that displays a single button in the middle title "Next Order".
When the button is clicked, it should fetch all pending
orders, from specified categories, from a specified store view. (i
guess i would need a configuration area for that)
the page would then display 2 sections, bottom/top. The lower section displays a orders table with orders in cue and their info. The top section displays the full order details (items purchased, customer info, etc.) of the next order in the cue.
I will then have a button in the top section to be clicked when the order is packed and complete, which will change that order to a different status.

here what i believe is the hard part... Another feature i would love to integrate, is for the system to be able to bring up the next order in the cue if someone else is loggeed in and viewing/processing a order that is higher in the cue.
example: if Packer1 is logged in and viewing/processing an order thats 1st in line. if Packer2 logs in and goes to smae page, the system automatically selects the order 2nd in line.

I tried attempting this by using @Marius magento extension Ultimate Module Creator. which is a lot of help. learning slowly but i need to pick it up to get this done in time. This is a personal project btw!

Any help you can provide will be greatly appreciated. if you can provide some codes, even better.


texts:
There is an integrety violation when I try to save a product. I did some searches and some suggested to join tables and check for null values. I tried that without luck. How can I solve/debug this?

Integrity constraint violation: 1452 Cannot add or update a child row:
a foreign key constraint fails (`db`.`catalog_product_entity_int`,
CONSTRAINT`FK_CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN
KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`)
ON D)' in /lib/Zend/Db/Statement/Pdo.php:234


texts: How to remove the cross mark in out of stock product swatch?

texts:
I have enabled the out of stock product to be displayed in frontend. In one of the configurable product, I have set out of stock for one of the variant and in the frontend, I can see the out of stock product but there is a cross mark in the swatch.
Also, I want to show the button text as "Out Of Stock" instead of "Add to Cart" for the out of stock products?

How can I remove the cross mark and make it unclickable and make the button change?


texts: $widget._getNewPrices js error magento 2 color swatches

texts:
When i click on color swatches i got error $widget._getNewPrices is not function on console and image does not change.

can anyone  help me to solve this error ?

Thanks


texts: Magento2 : Free shipping and Flat Rate for specified states

texts:
How the customers who place orders to be shipped within the 48 contiguous states we should show a text stating

  Shipping is free if you need shipping to any one of the 48 contiguous
  states. Your order will get delivered in 2 to 3 Business Days.
  Shipping to Alaska and Hawaii are Chargeable at $2 Per item


texts: How to disable pagination on mysite.com/checkout/cart/ page?

texts:
Doase anybody know how to disable pagination on mysite.com/checkout/cart/ page ?

I Want all my cart items to appear on the same page.

How to do it using XML config ( if possible ) ?

Thanks a lot!


texts: Add custom image upload attribute to product

texts:
I Have tried to add new image upload attribute to Magento Product using sql upgrade script, but I got the error message like:

  Invalid backend model specified:
  catalog/product_attribute_backend_image

The file has name upgrade-0.0.1-0.0.2.php which is correct because I see new version in core_resource table.

There is my code:

$installer = $this;
$installer->startSetup();
$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'image_cert', array(
    'type' => 'varchar',
    'group' => 'Design',
    'label' => 'Certificate Image',
    'input' => 'image',
    'backend' => 'catalog/product_attribute_backend_image',
    'required' => false,
    'sort_order' => 55,
    'global' => 1
));
$installer->endSetup();

What I'm doing wrong?


texts: redirect to another action in same controller with paramters

texts:
i want to pass parameter from one action to another in same controller
  how to do that

also how the other function receive(how to get it ) parameters??

$parameters =array('user_id'=>5,'name'=>'test');
is $this->_forward('edit',NULL,NULL,$parameters); correct or what is the correct way ??

and if it is correct how to get parameters in edit action


texts:
Here is my HTML and JS:

    click

    blah

The Problem is: the modal works only once. After closing it the button does not spawn a second modal.


texts:
I want to inject Model into core block module. That it's a simple thing to do in the wrong way (Editing core block). But i want to know how to do it in the right way. Because i want to retrieve User data in the main page.

So, how can i do it, without editing core files?

Im customizing my templates and i want to show users name into the main page, Magento_CatalogWidget/templates/product/widget/content/grid.phtml.

To do that i need to inyect \Magento\Customer\Model\Session, the answer is where?

For now i have into grid.phtml the follwing code :

  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  $name = $objectManager->create('\Magento\Customer\Model\Session')
          ->getCustomer()->getName();

Thanks!


texts:
Magento 2.2. Please can anyone help with this I am trying to run this in CLI

  php bin/magento indexer:reindex catalogsearch_fulltext

Notice: getimagesize(): Read error! in /home/redjohnco/public_html/vendor/magento/module-catalog/Model/Product/Image.php on line 420

I thought this issue would be bypass or resolved by switching from GD2 to ImageMagick


texts: How To Add Whatsup Share on product Page in magento2?

texts: How to add whatsup share link in magento2 Product page?


texts: Is there any way to disable the minicart dropdown and activate the responsive popup when in mobile version?


texts:
I installed magento 1.9.4.5, everything is fine
After order created, i wasn't redirected to the success page. I looked saveOrder Function and added this code, also didn't work.
Mage::app()->getFrontController()->getResponse()->setRedirect('checkout/onepage/success/');

And
$this->_redirect('checkout/onepage/success/');
return;

Please help me?


texts:
I have added a new theme from sample theme module : ( parent theme is luma)
 https://github.com/magento/magento2-samples/tree/master/sample-module-theme

But it only shows blank page, no product is shown.
 Do you know why ? How to fix it.


texts: Does  also affect the load order of plugin?

texts:
According to magento devdocs

   declares the list of components that must be loaded before the current component is loaded. It’s used for loading different kind of files: configuration files, view files (including CSS, Less, and template files), or setup classes. Note that  does not affect the loading of regular classes (non-setup classes).

So if we define any same plugin(suppose before) for same function and with same order in different module(A and B). If module A depends on module B then should plugin A loads after B?


texts: Grid UI PageActions How to show plain text?

texts:
I am developing the action link in the grid ui component.
I try to add a condition that if customer is not allow to view, remove the hyperlink and show "Not Allowed" in plain text.

I know how to add a hyperlink in the pageactions class but I cannot find a way to show the plain text. Follows is the code I tried.

if ($isAllow) {
    $href = $this->getContext()->getUrl("custom/lesson/lessoninfo",["lesson_id"=>$item['lesson_id'], "product_id"=>$item['product_id']]);
            $label = "View";
    } else {
            $href = "";
            $label = "Not Allow";
    }

            $item[$name]["view"] = [
                "href"=>$href,
                "label"=>$label
            ];

The hyperlink is not removed and if I click into the link. It will go to current page and add undefined after the url.


texts:
Below is my code to get CMS page title using CMS page url-key (identifer)

$formatIdentifier = "'{$_product->getUrlKey()}'";
$PageData = Mage::getModel('cms/page')->load($formatIdentifier,'identifier');
echo print_r($BuyingTitle->getData());exit;

The above code returns null, while the below code returns expected data.

$PageData = Mage::getModel('cms/page')->load('my-identifier','identifier');
echo print_r($BuyingTitle->getData());exit;

How can I pass my dynamic identifier using variable to get CMS page data ?

Thanks


texts: Delta migration not migrating some table's data

texts:
I am doing delta migration and first delta migration failed to migrate some record for below tables.

m2_cl_sales_flat_order_grid
m2_cl_sales_flat_invoice_grid
m2_cl_sales_flat_shipment_grid

In above tables column processed is 0

Example:

Initial order in M1 - 100
Using data migration, order in M2 - 100
New order in M1 - 10
Delta migration did for 105 to 110

Grid order data is missed from 101-104

Now when I run delta migration, it is migration new grid order data for new orders.

Is there any log available, where I can check issue ?

can I migrate them manually ?

Thanks in advance!


texts: How to use and save custom order item field/attribute

texts:
I have created a custom field (customer_sku) in sales_order_item, sales_invoice_item, sales_shipment_item and quote_item.
How can I add this field to the complete order process?
Thx, Christian


texts: Magento 2 - Apply coupon code on order excluding usage checks

texts:
I want to apply Coupon Codes on edited orders regardless if that coupon is active/expired.
Right now my investigations lead me to the fact that setCoupon method of orders checks the validity of coupon automatically.
But I want sort of admin rights on that
i.e If I am admin than coupon usage checks should automatically be exempted.


texts: Debugging customer session issues... tools?

texts:
We periodically run into issues on our M2.2.3 website, where customer cannot seem to complete their checkout process (spinning circle for example).

It has been a nightmare to try and debug these issues since no server-side logs are generated for certain kinds of problems (and many customers refuse to want to help us debug the problem... I cannot blame them in that case).

I'm wondering if anybody knows of an extension that works something like the Advanced Template Hints module that would allow our tech support (while talking to the customer) add a url key, that would then dump a much greater debug detail to the customer/or server for further debugging.

This would be extremely helpful, but its a problem I've been struggling with for years with M2.


texts: How to Creating a Custom Product Type in Magento 1.9

texts:
How to create a Custom product type by default.

It like Affiliate Products.


texts: In a module, know which component asks informations

texts:
collaborating to Lillik/PriceDecimal project, I'm stuck on a detail:  how can I know which page/module et calling my function ?
For now, I'm using a global variable
    $Val = $this->getConfig()->getPricePrecision();
    $Val =  (strstr($_SERVER['PHP_SELF'], 'checkout') > -1 ) ? $this->getConfig()->getPricePrecisionCheckout() :  $Val;

I want to replace the $_SERVER['PHP_SELF'] by the proper Magento's object.
I can I do that?
Thanks for reading and for your help.


texts:
When I click 'Save & Duplicate' button, 'Please wait...' show up and it can't finish. Just show 'Please wait...' endless

What should I check?

No 3rd party module, Fresh installed Magento2 with sample products


texts: Some new products not showing in homepage

texts:
I've a site on magento 1.9.2.4, in home page there is a tab for new products, selected from date in product setting.

The strange thing, some product is not showing in home page, even though I set the date as new.

Suggest to solve this problem?


texts: Magento 2 {{store url="tipps"}} trailing slash and redirect

texts:
If I add a link in WYSIWYG-Editor like {{store url="tipps"}}. Magento 2 makes link to http://www.domain.at/tipps/. But, after clicking on the link http://www.domain.at/tipps/ Magento is redirecting to  http://www.domain.at/tipps (without the slash).

How can I configure Magento 2 to make the correct link http://www.domain.at/tipps instead of http://www.domain.at/tipps/?


texts: How to create Admin form in Magento 2 without using Uicomponent?

texts:
I have a grid which is showing data and know I want to create action and Add new Button. But I don't want to use Uicomponent.

Can someone tell me how to create a admin form step by step (Admin form CRUD without using Ui Component).


texts: Checkout error on magento 2.3.2 after upgrade

texts:
i had upgraded magento version to 2.3.2 and on checkout page i am getting following error

payment.js:50 Uncaught ReferenceError: getPaymentInformation is not defined
    at UiClass.navigate (payment.js:50)
    at UiClass.initialize (payment.js:39)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at Object.deferred.<computed> (jquery.js:3461)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)


texts: How to get color name in simple product?

texts:
I used

echo $_product->getColor()

but i will print code = 24 , instead of color name.


texts: Custom Attribute on Product Listing Magento

texts:
Greeting,

Though there are several answers to this question, just need to add AttributeCode to list.phtml page. But here lies my problem i am unable to edit my list.phtml. Is there any why through which i can locate correct list.phtml file my magento is using.

i am editing app/design/frontend/default/mytheme/template/catalog/product/list.phtml this file, but nothing is happening on fronthand.

I want to show the attribute both on homepage product lsitings & on category listings.
Please suggest what can i do.


texts: _save_after triggered before saving the product data in database

texts:
Intro: I'm a Python(Django) developer who is working at a company where
we use Magento in the backend to sell products on our website. I'm not
really experienced in Magento. We are using Magento version 1.7.0.2.

What I want: On certain events like new product/order/customer create, I
want Magento to do some functions. Eg: For new product create, I want
magento to call a celery task which will check certain conditions and
send an email to the site merchandiser if some data is wrong.

What I have done: As far as I understand, Magento has an event like
_save_after which is triggered after a new product is saved. Using
this, Magento is calling the celery task with the entity_id of the
product on this even trigger. When the celery task is triggered, I'm
querying the database(catalog_product_entity table) for the product using the entity_id sent from
Magento.

Issue: In some cases, when I'm querying the database for the newly
created product, the database returns 0 rows. This happens almost all
the time.

What I think: I think, there might be some sort of asynchronous queueing
done in Magento which is causing this issue. Can someone give me an
explanation to this and let me know how to fix this issue?

I've searched a lot about this and still not able to figure what caused
this.


texts:
I have an AJAX POST setup within my template file currently that has 3 values, which I want to POST to my Index.php within my Block.

However, my module is an AdminHTML module and this cannot be changed. From my understanding modules using AdminHTML use extra security measures and sending AJAX isn't quite as easy as doing it in raw jQuery -> PHP.

My AJAX Post request is below contained in view/adminhtml/templates/file.phtml:

    let post = $.post("Index.php",
         {
             "product_id": productID,
             "product_value": value['value'],
             "customer_group_id": custGroupID
         },
         function(data, status){
             console.log("status", status);
             console.log("Customer Group Price: ", data);
         });

In my PHP file (block/adminhtml/index/index.php) I have tried things such as:

$productID = $_POST['product_id'];
$custGroupID = $_POST['customer_group_id'];
$productVal = $_POST['product_value'];

And also:

if(isset($_POST['product_id']) && isset($_POST['customer_group_id']) && isset($_POST['product_value'])){
    echo(setProductCustomerGroupPrice($_POST['product_id'], $_POST['customer_group_id'], $_POST['product_value']));
}

However it always throws error messages. Likely because of this extra security layer.


texts: How can I specify 0000-00-00 as Year-Month-Date while Save

texts:
I want to save a time reference in database which date part should be always 0000-00-00.

I have below code with me.

$entity = Mage::getModel('my_entity_reference')->load(1);
$entity->setCloseTime('0000-00-00 05:05:05');
$entity->save();

But this gives me an entry 0000-00-00 00:00:00 for close_time column. Please note close_time field is of type DATETIME.

If I try below code :

$entity = Mage::getModel('my_entity_reference')->load(1);
$entity->setCloseTime('2016-09-09 05:05:05');
$entity->save();

This gives me a result correctly as 2016-09-09 05:05:05 for the column close_time.

This means we cannot use 0000-00-00 as Y-m-d while we perform a save. So,

How can I specify year, month, date as 0000-00-00 in Magento and save it ?


texts:
In file module magento have function
public function formatPrecision(
    $price,
    $precision,
    $options = [],
    $includeContainer = true,
    $addBrackets = false
) {
    if (!isset($options['precision'])) {
        $options['precision'] = $precision;
    }
    if ($includeContainer) {
        return '' . ($addBrackets ? '[' : '') . $this->formatTxt(
            $price,
            $options
        ) . ($addBrackets ? ']' : '') . '';
    }
    return $this->formatTxt($price, $options);
}

I write di.xml
<type name="Magento\Directory\Model\Currency">
    <plugin name="afterFormatPrecision" type="Commercers\PriceItemprop\Plugin\Currency" sortOrder="1"/>
</type>

And i have afterFormatPrecision
public function afterFormatPrecision(
    \Magento\Directory\Model\Currency $subject
){
    return str_replace('','','');
}

But function after not working. Please help me!


texts: How to make magento 1.9 to use postfix to send email to client?

texts:
I have Magento store deployed on an ec2 instance which was moved from shared hosting to the standalone server on AWS.
On the server I have configured Postfix as the MTA agent to allow Magento to send emails about orders and transaction details.
On the shared server, the emails would be sent to the customer correctly.
But on EC2 instance Magento is unable to send the emails.
How can I make Magento send client Emails?
Postfix is configured correctly and I am able to send Test emails from the command line using postfix from port 25.